diff --git a/sdk/compute/azure-mgmt-compute/_meta.json b/sdk/compute/azure-mgmt-compute/_meta.json index b932f2acec7d..a23f821b19c5 100644 --- a/sdk/compute/azure-mgmt-compute/_meta.json +++ b/sdk/compute/azure-mgmt-compute/_meta.json @@ -1,11 +1,11 @@ { + "commit": "b95d069541ab1da47c9eceb1981c681493c26c68", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.1.11", + "@autorest/python@6.2.1", "@autorest/modelerfour@4.24.3" ], - "commit": "3cc85e694a07ba8ea5d0f21cefef71205dc3846e", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/compute/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.1.11 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/compute/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.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/compute/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py index dc23198d774c..07ae3e5b2078 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2015-06-15") # type: str + api_version = kwargs.pop("api_version", "2015-06-15") # type: Literal["2015-06-15"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json index 63ad4ca3d36e..1d0760131ce5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json @@ -107,4 +107,4 @@ "virtual_machine_scale_sets": "VirtualMachineScaleSetsOperations", "virtual_machine_scale_set_vms": "VirtualMachineScaleSetVMsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py index 566ac3f293a4..3c8c2675ca27 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2015-06-15") # type: str + api_version = kwargs.pop("api_version", "2015-06-15") # type: Literal["2015-06-15"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py index 5a65b9881106..77749c00404c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -145,7 +150,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -217,7 +222,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -277,7 +282,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -326,7 +331,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -414,7 +419,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py index 295b15f53ed8..7435d1550b13 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py index 2cd6c8f3d1ca..e3ccad03820e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py index d509149aaef3..530d74ac6121 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -251,7 +256,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -486,7 +491,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -544,7 +549,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -611,7 +616,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -687,7 +692,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py index bb0155804561..b3a5eeea81dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py index 1dbfbeb92791..8a0d1707eacc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -42,6 +43,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -145,7 +150,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -203,7 +208,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -271,7 +276,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -329,7 +334,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -395,7 +400,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -464,7 +469,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -527,7 +532,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -598,7 +603,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -684,7 +689,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -752,7 +757,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -810,7 +815,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -876,7 +881,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -934,7 +939,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1000,7 +1005,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py index 01cf391f8e43..6ae4446bc98d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_instances_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -238,7 +243,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -295,7 +300,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -358,7 +363,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -424,7 +429,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -476,7 +481,7 @@ async def _deallocate_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -646,7 +651,7 @@ async def begin_deallocate( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -710,7 +715,7 @@ async def _delete_instances_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -871,7 +876,7 @@ async def begin_delete_instances( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -943,7 +948,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -993,7 +998,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1077,7 +1082,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1165,7 +1170,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1252,7 +1257,7 @@ async def _power_off_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1422,7 +1427,7 @@ async def begin_power_off( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1486,7 +1491,7 @@ async def _restart_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1650,7 +1655,7 @@ async def begin_restart( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1714,7 +1719,7 @@ async def _start_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1878,7 +1883,7 @@ async def begin_start( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1942,7 +1947,7 @@ async def _update_instances_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2103,7 +2108,7 @@ async def begin_update_instances( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2163,7 +2168,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2226,7 +2231,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py index d9922e7074a3..dd331b763a14 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py index ae7e77462712..e2dfb4a23278 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,6 +47,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ async def _capture_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -247,7 +252,7 @@ async def begin_capture( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -307,7 +312,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -462,7 +467,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -519,7 +524,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -582,7 +587,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -624,7 +629,7 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -651,7 +656,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -700,7 +705,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -764,7 +769,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -833,7 +838,7 @@ async def generalize( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -883,7 +888,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -965,7 +970,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1052,7 +1057,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1135,7 +1140,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1199,7 +1204,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1256,7 +1261,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1319,7 +1324,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1376,7 +1381,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1496,7 +1501,7 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1559,7 +1564,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_models_py3.py index 6aa72523a17e..f350b1dc2b2b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -52,8 +57,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py index 9b29763ae5fb..026c05754ff0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_available_sizes_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -296,7 +301,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -368,7 +373,7 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -428,7 +433,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -476,7 +481,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -563,7 +568,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py index c023c749cd60..36a74cefc842 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py index 17b488d87309..aa7a999f44d1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py index 01f5a095a2bf..39c7694ec6ab 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -391,7 +396,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -454,7 +459,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -626,7 +631,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -684,7 +689,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -751,7 +756,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -827,7 +832,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py index 8d6b6ec61ead..d3e9b1eef616 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py index c656163468db..1f70f6896206 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +113,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_get_instance_view_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -211,7 +216,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +255,7 @@ def build_power_off_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +287,7 @@ def build_restart_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -314,7 +319,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +378,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -439,7 +444,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -496,7 +501,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -564,7 +569,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -621,7 +626,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -687,7 +692,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -756,7 +761,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -819,7 +824,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -890,7 +895,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -976,7 +981,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1044,7 +1049,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1101,7 +1106,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1167,7 +1172,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1224,7 +1229,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1290,7 +1295,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py index 871295f99a3e..74752c9c270c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +114,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_instances_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -208,7 +213,7 @@ def build_get_instance_view_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +270,7 @@ def build_list_all_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,7 +298,7 @@ def build_list_skus_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +329,7 @@ def build_power_off_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -358,7 +363,7 @@ def build_restart_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -392,7 +397,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -426,7 +431,7 @@ def build_update_instances_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -460,7 +465,7 @@ def build_reimage_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -518,7 +523,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -672,7 +677,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -729,7 +734,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -792,7 +797,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -856,7 +861,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -908,7 +913,7 @@ def _deallocate_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1078,7 +1083,7 @@ def begin_deallocate( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1141,7 +1146,7 @@ def _delete_instances_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1302,7 +1307,7 @@ def begin_delete_instances( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1373,7 +1378,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1423,7 +1428,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1507,7 +1512,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1595,7 +1600,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1682,7 +1687,7 @@ def _power_off_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1852,7 +1857,7 @@ def begin_power_off( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1915,7 +1920,7 @@ def _restart_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2079,7 +2084,7 @@ def begin_restart( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2142,7 +2147,7 @@ def _start_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2306,7 +2311,7 @@ def begin_start( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2369,7 +2374,7 @@ def _update_instances_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2530,7 +2535,7 @@ def begin_update_instances( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2589,7 +2594,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2652,7 +2657,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py index 3763f1da6ce2..23459b0644e5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py index 92e0d8a7b0e9..29fe70742d2d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,12 +139,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +182,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +213,7 @@ def build_generalize_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -232,7 +242,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +270,7 @@ def build_list_all_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -286,7 +296,7 @@ def build_list_available_sizes_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +325,7 @@ def build_power_off_request(resource_group_name: str, vm_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -344,7 +354,7 @@ def build_restart_request(resource_group_name: str, vm_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +383,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -402,7 +412,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -464,7 +474,7 @@ def _capture_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -624,7 +634,7 @@ def begin_capture( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -683,7 +693,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -835,7 +845,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -892,7 +902,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -955,7 +965,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -997,7 +1007,7 @@ def get_long_running_output(pipeline_response): @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1024,7 +1034,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1073,7 +1083,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1137,7 +1147,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1203,7 +1213,7 @@ def generalize(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1252,7 +1262,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1333,7 +1343,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1419,7 +1429,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1502,7 +1512,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1566,7 +1576,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1622,7 +1632,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1685,7 +1695,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1741,7 +1751,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1804,7 +1814,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1860,7 +1870,7 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1923,7 +1933,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py index d6ba988acaac..ea01eb6d6c12 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2016-03-30") # type: str + api_version = kwargs.pop("api_version", "2016-03-30") # type: Literal["2016-03-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json index 300665ff9dba..4af9ae118ddf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json @@ -107,4 +107,4 @@ "virtual_machine_scale_sets": "VirtualMachineScaleSetsOperations", "virtual_machine_scale_set_vms": "VirtualMachineScaleSetVMsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py index 4c1fdb009898..3ad15b35fcb8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2016-03-30") # type: str + api_version = kwargs.pop("api_version", "2016-03-30") # type: Literal["2016-03-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py index 9f57931762e6..2268eaedab52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -146,7 +151,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -218,7 +223,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -278,7 +283,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -330,7 +335,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -413,7 +418,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -501,7 +506,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py index 242115da34b0..29b2ce410c0a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py index 4fae9c145f72..eefdd2e4741b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py index 2b7f26cf6647..7d35f6d3e293 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -251,7 +256,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -486,7 +491,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -544,7 +549,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -611,7 +616,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -687,7 +692,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py index f4ca301b849e..61cfbc790033 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py index fdc4198ef4e4..13cede2497b2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -42,6 +43,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -145,7 +150,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -203,7 +208,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -271,7 +276,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -329,7 +334,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -395,7 +400,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -464,7 +469,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -527,7 +532,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -598,7 +603,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -684,7 +689,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -752,7 +757,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -810,7 +815,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -876,7 +881,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -934,7 +939,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1000,7 +1005,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py index a15e597c04f0..c93ff7f40242 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_instances_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -238,7 +243,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -295,7 +300,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -358,7 +363,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -424,7 +429,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -476,7 +481,7 @@ async def _deallocate_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -646,7 +651,7 @@ async def begin_deallocate( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -710,7 +715,7 @@ async def _delete_instances_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -871,7 +876,7 @@ async def begin_delete_instances( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -943,7 +948,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -993,7 +998,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1077,7 +1082,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1165,7 +1170,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1252,7 +1257,7 @@ async def _power_off_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1422,7 +1427,7 @@ async def begin_power_off( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1486,7 +1491,7 @@ async def _restart_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1650,7 +1655,7 @@ async def begin_restart( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1714,7 +1719,7 @@ async def _start_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1878,7 +1883,7 @@ async def begin_start( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1942,7 +1947,7 @@ async def _update_instances_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2103,7 +2108,7 @@ async def begin_update_instances( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2163,7 +2168,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2226,7 +2231,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py index 4a90ab9be5ef..6f6ce12e0df5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py index 389d2de42895..91eb62934660 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ async def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -151,7 +156,7 @@ async def _capture_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -311,7 +316,7 @@ async def begin_capture( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -371,7 +376,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -526,7 +531,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -583,7 +588,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -646,7 +651,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -715,7 +720,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -764,7 +769,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -828,7 +833,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ async def generalize( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -947,7 +952,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1029,7 +1034,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1116,7 +1121,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1199,7 +1204,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1263,7 +1268,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1320,7 +1325,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1383,7 +1388,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1440,7 +1445,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1503,7 +1508,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1560,7 +1565,7 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1623,7 +1628,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models_py3.py index 4f9b95dd7426..4854ffb1eab3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -52,8 +57,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs @@ -2590,7 +2595,7 @@ class VirtualMachineIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is @@ -3081,7 +3086,7 @@ class VirtualMachineScaleSetIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine scale set. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py index 117744c7a4d8..c284c1a159b1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +143,7 @@ def build_list_by_subscription_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +199,7 @@ def build_list_available_sizes_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +329,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -396,7 +401,7 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -505,7 +510,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -587,7 +592,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -674,7 +679,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py index 958f999486b9..3ae5e6a5c21a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py index 0cf794554e49..58f0efcfe0df 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py index 286b04245650..94f6f40baeef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -391,7 +396,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -454,7 +459,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -626,7 +631,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -684,7 +689,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -751,7 +756,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -827,7 +832,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py index 3b5f3234a7e7..d783202b7607 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py index 353b819309e8..628696b8567a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +113,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_get_instance_view_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -211,7 +216,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +255,7 @@ def build_power_off_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +287,7 @@ def build_restart_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -314,7 +319,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +378,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -439,7 +444,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -496,7 +501,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -564,7 +569,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -621,7 +626,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -687,7 +692,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -756,7 +761,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -819,7 +824,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -890,7 +895,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -976,7 +981,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1044,7 +1049,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1101,7 +1106,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1167,7 +1172,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1224,7 +1229,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1290,7 +1295,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py index 6f10c68604f0..6cf24d85c1fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +114,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_instances_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -208,7 +213,7 @@ def build_get_instance_view_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +270,7 @@ def build_list_all_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,7 +298,7 @@ def build_list_skus_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +329,7 @@ def build_power_off_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -358,7 +363,7 @@ def build_restart_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -392,7 +397,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -426,7 +431,7 @@ def build_update_instances_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -460,7 +465,7 @@ def build_reimage_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -518,7 +523,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -672,7 +677,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -729,7 +734,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -792,7 +797,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -856,7 +861,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -908,7 +913,7 @@ def _deallocate_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1078,7 +1083,7 @@ def begin_deallocate( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1141,7 +1146,7 @@ def _delete_instances_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1302,7 +1307,7 @@ def begin_delete_instances( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1373,7 +1378,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1423,7 +1428,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1507,7 +1512,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1595,7 +1600,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1682,7 +1687,7 @@ def _power_off_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1852,7 +1857,7 @@ def begin_power_off( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1915,7 +1920,7 @@ def _restart_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2079,7 +2084,7 @@ def begin_restart( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2142,7 +2147,7 @@ def _start_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2306,7 +2311,7 @@ def begin_start( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2369,7 +2374,7 @@ def _update_instances_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2530,7 +2535,7 @@ def begin_update_instances( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2589,7 +2594,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2652,7 +2657,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py index 85bea9b2f5d9..7c9eacb1c406 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py index c3cebe267623..a7afb8f89374 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_get_extensions_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -141,7 +146,7 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,12 +172,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +215,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -236,7 +246,7 @@ def build_generalize_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +275,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,7 +303,7 @@ def build_list_all_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +329,7 @@ def build_list_available_sizes_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +358,7 @@ def build_power_off_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -377,7 +387,7 @@ def build_restart_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -406,7 +416,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -435,7 +445,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -507,7 +517,7 @@ def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -560,7 +570,7 @@ def _capture_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -720,7 +730,7 @@ def begin_capture( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -779,7 +789,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -931,7 +941,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -988,7 +998,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1051,7 +1061,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1093,7 +1103,7 @@ def get_long_running_output(pipeline_response): @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1120,7 +1130,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1169,7 +1179,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1233,7 +1243,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1299,7 +1309,7 @@ def generalize(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1348,7 +1358,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1429,7 +1439,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1515,7 +1525,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1598,7 +1608,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1662,7 +1672,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1718,7 +1728,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1781,7 +1791,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1837,7 +1847,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1900,7 +1910,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1956,7 +1966,7 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -2019,7 +2029,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py index fe7665f23cfe..0750c30fe49c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2016-04-30-preview") # type: str + api_version = kwargs.pop("api_version", "2016-04-30-preview") # type: Literal["2016-04-30-preview"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json index 8ccb750e9a25..8eb2b52a1cc8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json @@ -110,4 +110,4 @@ "disks": "DisksOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py index c0f4ee644cc1..2e6566798994 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2016-04-30-preview") # type: str + api_version = kwargs.pop("api_version", "2016-04-30-preview") # type: Literal["2016-04-30-preview"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py index 58e959253e9b..141b05309d45 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -146,7 +151,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -218,7 +225,9 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -278,7 +287,9 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -325,7 +336,9 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Availabi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -407,7 +420,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -495,7 +510,9 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py index 5f6e9ef9ba39..f1ecf4dc76ea 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +240,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +299,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +456,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +527,9 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +577,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -627,7 +644,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -682,7 +701,9 @@ 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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -763,7 +784,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -848,7 +871,9 @@ async def _grant_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1013,7 +1038,9 @@ async def begin_grant_access( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1070,7 +1097,9 @@ async def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1135,7 +1164,9 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py index e7659ba6c9f3..b77882a5e250 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -227,7 +234,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -284,7 +293,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -347,7 +358,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -415,7 +428,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -465,7 +480,9 @@ 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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -547,7 +564,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py index 3b27b6cf001f..5291d37b31d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +243,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +302,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +464,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -521,7 +534,9 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -569,7 +584,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -633,7 +650,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +707,9 @@ 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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -769,7 +790,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -854,7 +877,9 @@ async def _grant_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1016,7 +1041,9 @@ async def begin_grant_access( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1073,7 +1100,9 @@ async def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1137,7 +1166,9 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py index e0317065f14e..45ee4e36d082 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,9 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py index 10173df391da..aa72da3e6766 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +153,9 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +230,9 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py index a7127c4cd529..530d06752686 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +259,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +324,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +498,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +558,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -612,7 +627,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +705,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py index fae6ac7bfb7a..e526a15f46f5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +177,9 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +244,9 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +302,9 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +365,9 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py index 5d66f483f056..e1040a75634b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -43,6 +44,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,9 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -146,7 +153,9 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -204,7 +213,9 @@ async def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -271,7 +282,9 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -329,7 +342,9 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -397,7 +412,9 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -455,7 +472,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -521,7 +540,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -590,7 +611,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -653,7 +676,9 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -720,7 +745,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -806,7 +833,9 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -874,7 +903,9 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -932,7 +963,9 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -998,7 +1031,9 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1056,7 +1091,9 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1122,7 +1159,9 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py index a9992ff875f0..f4bbe3c5b08b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -48,6 +49,10 @@ build_update_instances_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -239,7 +246,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +305,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -359,7 +370,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -425,7 +438,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -477,7 +492,9 @@ async def _deallocate_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -647,7 +664,9 @@ async def begin_deallocate( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -711,7 +730,9 @@ async def _delete_instances_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -873,7 +894,9 @@ async def begin_delete_instances( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -945,7 +968,9 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -995,7 +1020,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1079,7 +1106,9 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1167,7 +1196,9 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1254,7 +1285,9 @@ async def _power_off_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1424,7 +1457,9 @@ async def begin_power_off( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1488,7 +1523,9 @@ async def _restart_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1652,7 +1689,9 @@ async def begin_restart( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1716,7 +1755,9 @@ async def _start_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1880,7 +1921,9 @@ async def begin_start( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1944,7 +1987,9 @@ async def _update_instances_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2106,7 +2151,9 @@ async def begin_update_instances( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2166,7 +2213,9 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2229,7 +2278,9 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2286,7 +2337,9 @@ async def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -2350,7 +2403,9 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py index 354db5619177..a8f64d45aa0b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,9 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py index ccbb5726116c..c4a4d9529dce 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -48,6 +49,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -99,7 +104,9 @@ async def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -152,7 +159,9 @@ async def _capture_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -314,7 +323,9 @@ async def begin_capture( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +385,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -529,7 +542,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -586,7 +601,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -649,7 +666,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -691,7 +710,7 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -718,7 +737,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -767,7 +788,9 @@ async def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -831,7 +854,9 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -888,7 +913,9 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -952,7 +979,9 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1021,7 +1050,9 @@ async def generalize( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1071,7 +1102,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1153,7 +1186,9 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1240,7 +1275,9 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1323,7 +1360,9 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1387,7 +1426,9 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1444,7 +1485,9 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1507,7 +1550,9 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1564,7 +1609,9 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1627,7 +1674,9 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1684,7 +1733,9 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1747,7 +1798,9 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_models_py3.py index 2a4309684434..bcfcc2b0be25 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -75,8 +80,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs @@ -3776,7 +3781,7 @@ class VirtualMachineIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is @@ -4386,7 +4391,7 @@ class VirtualMachineScaleSetIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine scale set. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py index 279919f5055d..a7aab6e01a7e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +83,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +116,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +147,9 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -160,7 +173,9 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,7 +205,9 @@ def build_list_available_sizes_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +337,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -392,7 +411,9 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -452,7 +473,9 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -499,7 +522,9 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.AvailabilityS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -581,7 +606,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -669,7 +696,9 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py index 57fc92757712..d3f93c9a769e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +83,9 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +117,9 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,7 +148,9 @@ def build_delete_request(resource_group_name: str, disk_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +179,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +209,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -220,7 +237,9 @@ def build_grant_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -254,7 +273,9 @@ def build_revoke_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +333,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -467,7 +490,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -524,7 +549,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -679,7 +706,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -748,7 +777,9 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -796,7 +827,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -861,7 +894,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -915,7 +950,9 @@ 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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -995,7 +1032,9 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1080,7 +1119,9 @@ def _grant_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1239,7 +1280,9 @@ def begin_grant_access( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1296,7 +1339,9 @@ def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1361,7 +1406,9 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py index 0d26effaad16..4950f226f1f0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +83,9 @@ def build_delete_request(resource_group_name: str, image_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +116,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +149,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +179,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,7 +234,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -368,7 +385,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -425,7 +444,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -488,7 +509,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -556,7 +579,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -605,7 +630,9 @@ 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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -686,7 +713,9 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py index e9b2b2cb084b..36e207667e63 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +85,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +119,9 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +152,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +183,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +213,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +241,9 @@ def build_grant_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -258,7 +277,9 @@ def build_revoke_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -316,7 +337,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -468,7 +491,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +550,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -679,7 +706,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -747,7 +776,9 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -795,7 +826,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -859,7 +892,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -913,7 +948,9 @@ 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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -993,7 +1030,9 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1078,7 +1117,9 @@ def _grant_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1234,7 +1275,9 @@ def begin_grant_access( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1291,7 +1334,9 @@ def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1355,7 +1400,9 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py index ef0062145ad2..03a5f7c25a06 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,9 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +104,9 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py index 82dfbd43f509..66839000636b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +78,9 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +119,9 @@ def build_list_versions_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +202,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +266,9 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +343,9 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py index a7f7f93e0383..657a88496ae6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +84,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +121,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +161,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +229,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -392,7 +407,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -455,7 +472,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -627,7 +646,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -685,7 +706,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -752,7 +775,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -828,7 +853,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py index 501b4fe65dcd..38d209391717 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +90,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +129,9 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +160,9 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +191,9 @@ def build_list_skus_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +270,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +354,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +421,9 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +479,9 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +542,9 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py index ba9cf2d1485c..4009cc270b2a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_reimage_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +83,9 @@ def build_reimage_all_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +117,9 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +151,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +219,9 @@ def build_get_instance_view_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +260,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +301,9 @@ def build_power_off_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -314,7 +335,9 @@ def build_restart_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +369,9 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -405,7 +430,9 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -471,7 +498,9 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +557,9 @@ def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -595,7 +626,9 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -652,7 +685,9 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -720,7 +755,9 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -777,7 +814,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -843,7 +882,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -912,7 +953,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -975,7 +1018,9 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1042,7 +1087,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1128,7 +1175,9 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1196,7 +1245,9 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1253,7 +1304,9 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1319,7 +1372,9 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1376,7 +1431,9 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1442,7 +1499,9 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py index 6e46cea37870..dcee9c45c693 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +85,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +151,9 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +187,9 @@ def build_delete_instances_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -208,7 +223,9 @@ def build_get_instance_view_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +254,9 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +284,9 @@ def build_list_all_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,7 +314,9 @@ def build_list_skus_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +347,9 @@ def build_power_off_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -358,7 +383,9 @@ def build_restart_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -392,7 +419,9 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -426,7 +455,9 @@ def build_update_instances_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -460,7 +491,9 @@ def build_reimage_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -491,7 +524,9 @@ def build_reimage_all_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -549,7 +584,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -703,7 +740,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -760,7 +799,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -823,7 +864,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -887,7 +930,9 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -939,7 +984,9 @@ def _deallocate_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1109,7 +1156,9 @@ def begin_deallocate( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1172,7 +1221,9 @@ def _delete_instances_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1334,7 +1385,9 @@ def begin_delete_instances( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1405,7 +1458,9 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1455,7 +1510,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1539,7 +1596,9 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1627,7 +1686,9 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1714,7 +1775,9 @@ def _power_off_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1884,7 +1947,9 @@ def begin_power_off( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1947,7 +2012,9 @@ def _restart_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2111,7 +2178,9 @@ def begin_restart( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2174,7 +2243,9 @@ def _start_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2338,7 +2409,9 @@ def begin_start( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2401,7 +2474,9 @@ def _update_instances_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2563,7 +2638,9 @@ def begin_update_instances( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2622,7 +2699,9 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2685,7 +2764,9 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2741,7 +2822,9 @@ def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -2805,7 +2888,9 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py index eafbef13cae1..5ae5899622e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,9 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +104,9 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py index 32a170dd007a..9c1a2ab7f7db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_get_extensions_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +82,9 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +118,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -141,7 +152,9 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,12 +180,19 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +225,9 @@ def build_convert_to_managed_disks_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -236,7 +258,9 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -267,7 +291,9 @@ def build_generalize_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -296,7 +322,9 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +352,9 @@ def build_list_all_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -350,7 +380,9 @@ def build_list_available_sizes_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -379,7 +411,9 @@ def build_power_off_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +442,9 @@ def build_restart_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -437,7 +473,9 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -466,7 +504,9 @@ def build_redeploy_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -538,7 +578,9 @@ def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -591,7 +633,9 @@ def _capture_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -753,7 +797,9 @@ def begin_capture( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -812,7 +858,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -967,7 +1015,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1024,7 +1074,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1087,7 +1139,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1129,7 +1183,7 @@ def get_long_running_output(pipeline_response): @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1156,7 +1210,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1205,7 +1261,9 @@ def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -1269,7 +1327,9 @@ def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1325,7 +1385,9 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1389,7 +1451,9 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1455,7 +1519,9 @@ def generalize(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1505,7 +1571,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1587,7 +1655,9 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1674,7 +1744,9 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1757,7 +1829,9 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1821,7 +1895,9 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1877,7 +1953,9 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1940,7 +2018,9 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1996,7 +2076,9 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -2059,7 +2141,9 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2115,7 +2199,9 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -2178,7 +2264,9 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py index 6efdc5a84517..1e67f625f4b3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-03-30") # type: str + api_version = kwargs.pop("api_version", "2017-03-30") # type: Literal["2017-03-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json index 5870983489c9..4c7668c89ff4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json @@ -114,4 +114,4 @@ "snapshots": "SnapshotsOperations", "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py index 332b54927e20..7fb8bc91472b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-03-30") # type: str + api_version = kwargs.pop("api_version", "2017-03-30") # type: Literal["2017-03-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py index 8dc7ce2c247c..7aa23101a952 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -150,7 +155,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -222,7 +227,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -282,7 +287,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -334,7 +339,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -417,7 +422,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -505,7 +510,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py index 9dc72e309aa6..3ddd98b7d281 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -627,7 +632,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -681,7 +686,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -761,7 +766,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -846,7 +851,7 @@ async def _grant_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1008,7 +1013,7 @@ async def begin_grant_access( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1130,7 +1135,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py index ba95a5fb5e64..dcc8878e95f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -224,7 +229,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -281,7 +286,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -344,7 +349,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -412,7 +417,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -461,7 +466,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -542,7 +547,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py index 75a07f72e7bd..f47fef101562 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._resource_skus_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,7 +70,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py index 101ff198ce75..c5f6433f4d7e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -635,7 +640,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -690,7 +695,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -771,7 +776,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -856,7 +861,7 @@ async def _grant_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1018,7 +1023,7 @@ async def begin_grant_access( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1075,7 +1080,7 @@ async def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1140,7 +1145,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py index a9cfa83bec18..0cfcfa208274 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py index da7e38a6a1fa..f925fe961891 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py index 75ae364e9246..f5c6231d1008 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -251,7 +256,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -486,7 +491,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -544,7 +549,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -611,7 +616,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -687,7 +692,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py index b7429de47ed0..7a93f80d75b0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py index c99e4b2b107f..517d1cbe3744 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py index faf8e4b18b5e..7d08f823fb5f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -380,7 +385,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -456,7 +461,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -512,7 +517,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index d985f2be77a0..10ae64d2541b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ async def _cancel_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_cancel_request( @@ -133,7 +138,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -190,7 +195,7 @@ async def _start_os_upgrade_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_os_upgrade_request( @@ -255,7 +260,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -324,7 +329,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py index 890d52b6a8e9..9dc6e4e130cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -43,6 +44,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -146,7 +151,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -204,7 +209,7 @@ async def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -271,7 +276,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -329,7 +334,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -397,7 +402,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -455,7 +460,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -521,7 +526,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -590,7 +595,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -653,7 +658,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -724,7 +729,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -810,7 +815,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -878,7 +883,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -936,7 +941,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1002,7 +1007,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1060,7 +1065,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1126,7 +1131,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py index 21efa0675e58..b69aa0415dfe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -248,7 +253,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -463,7 +468,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -520,7 +525,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -583,7 +588,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -649,7 +654,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -701,7 +706,7 @@ async def _deallocate_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -871,7 +876,7 @@ async def begin_deallocate( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +940,7 @@ async def _delete_instances_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1096,7 +1101,7 @@ async def begin_delete_instances( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1168,7 +1173,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1218,7 +1223,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1302,7 +1307,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1390,7 +1395,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1477,7 +1482,7 @@ async def _power_off_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1647,7 +1652,7 @@ async def begin_power_off( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1711,7 +1716,7 @@ async def _restart_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1875,7 +1880,7 @@ async def begin_restart( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1939,7 +1944,7 @@ async def _start_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2103,7 +2108,7 @@ async def begin_start( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2167,7 +2172,7 @@ async def _update_instances_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2328,7 +2333,7 @@ async def begin_update_instances( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2392,7 +2397,7 @@ async def _reimage_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2556,7 +2561,7 @@ async def begin_reimage( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2620,7 +2625,7 @@ async def _reimage_all_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2787,7 +2792,7 @@ async def begin_reimage_all( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py index 2ed36ff084df..862351b9c694 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py index ee3f45f46a9a..dc2b7753d0a3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -52,6 +53,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -103,7 +108,7 @@ async def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -154,7 +159,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -240,7 +245,7 @@ async def _capture_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -400,7 +405,7 @@ async def begin_capture( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -460,7 +465,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -615,7 +620,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -672,7 +677,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -735,7 +740,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -777,7 +782,7 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -804,7 +809,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -865,7 +870,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -913,7 +918,7 @@ async def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -977,7 +982,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1034,7 +1039,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1098,7 +1103,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1167,7 +1172,7 @@ async def generalize( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1217,7 +1222,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1299,7 +1304,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1386,7 +1391,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1469,7 +1474,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1533,7 +1538,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1590,7 +1595,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1653,7 +1658,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1710,7 +1715,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1773,7 +1778,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1830,7 +1835,7 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1893,7 +1898,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1950,7 +1955,7 @@ async def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -2013,7 +2018,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2070,7 +2075,7 @@ async def _run_command_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2223,7 +2228,7 @@ async def begin_run_command( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_models_py3.py index e6b5eaecd631..7fc0829b6088 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -75,8 +80,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs @@ -4742,7 +4747,7 @@ class VirtualMachineIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is @@ -5411,7 +5416,7 @@ class VirtualMachineScaleSetIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine scale set. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py index 22ddb0eb7910..6c29681834be 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +143,7 @@ def build_list_by_subscription_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +199,7 @@ def build_list_available_sizes_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -328,7 +333,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -400,7 +405,7 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -460,7 +465,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -509,7 +514,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -591,7 +596,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -678,7 +683,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py index 2c42452b1ae9..ac80ab7d3666 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,7 +142,7 @@ def build_delete_request(resource_group_name: str, disk_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +199,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -220,7 +225,7 @@ def build_grant_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -254,7 +259,7 @@ def build_revoke_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +317,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -467,7 +472,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -524,7 +529,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -679,7 +684,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -748,7 +753,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -796,7 +801,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -861,7 +866,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -915,7 +920,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -995,7 +1000,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1080,7 +1085,7 @@ def _grant_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1239,7 +1244,7 @@ def begin_grant_access( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1296,7 +1301,7 @@ def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1361,7 +1366,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py index 0aee7c49a2b9..fe5114a4ddf9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_delete_request(resource_group_name: str, image_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +143,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,7 +224,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -368,7 +373,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -425,7 +430,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -488,7 +493,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -556,7 +561,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -605,7 +610,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -686,7 +691,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py index bf2e00c2a101..fa84aa803bbd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +96,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py index f48331d9af56..a3045af05339 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,7 @@ def build_grant_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -258,7 +263,7 @@ def build_revoke_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -316,7 +321,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -471,7 +476,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -528,7 +533,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -685,7 +690,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -754,7 +759,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -802,7 +807,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -867,7 +872,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -921,7 +926,7 @@ 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1001,7 +1006,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1086,7 +1091,7 @@ def _grant_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1245,7 +1250,7 @@ def begin_grant_access( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1302,7 +1307,7 @@ def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1367,7 +1372,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py index 7301b32c38d0..94d26a6dc8fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py index 94a3f84e941b..84394e05e031 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py index b8cfbeef6305..343113732457 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -391,7 +396,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -454,7 +459,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -626,7 +631,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -684,7 +689,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -751,7 +756,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -827,7 +832,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py index f1783f7e96bb..e2f9829ed48e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py index 89fab5cfff9c..c0ddf254678c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py index d67d3bd6f27f..ccb5f947c33b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,7 +122,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +156,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -390,7 +395,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -448,7 +453,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -515,7 +520,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -591,7 +596,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -647,7 +652,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index b5a85f3be11e..79c7ef07b62e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_cancel_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_start_os_upgrade_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,7 @@ def build_get_latest_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def _cancel_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_cancel_request( @@ -225,7 +230,7 @@ def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -281,7 +286,7 @@ def _start_os_upgrade_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_os_upgrade_request( @@ -346,7 +351,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -414,7 +419,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py index 1356a3cebe1d..e15e6ce12707 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_reimage_all_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +113,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +209,7 @@ def build_get_instance_view_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +287,7 @@ def build_power_off_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -314,7 +319,7 @@ def build_restart_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -405,7 +410,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -471,7 +476,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +533,7 @@ def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -595,7 +600,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -652,7 +657,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -720,7 +725,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -777,7 +782,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -843,7 +848,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -912,7 +917,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -975,7 +980,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1046,7 +1051,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1132,7 +1137,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1200,7 +1205,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1257,7 +1262,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1323,7 +1328,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1380,7 +1385,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1446,7 +1451,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py index 26d566e57764..b41cb21a88af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -208,7 +213,7 @@ def build_delete_instances_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -242,7 +247,7 @@ def build_get_instance_view_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -299,7 +304,7 @@ def build_list_all_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +332,7 @@ def build_list_skus_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +363,7 @@ def build_power_off_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -392,7 +397,7 @@ def build_restart_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -426,7 +431,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -460,7 +465,7 @@ def build_update_instances_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -494,7 +499,7 @@ def build_reimage_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -528,7 +533,7 @@ def build_reimage_all_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -593,7 +598,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -751,7 +756,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -812,7 +817,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -966,7 +971,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1023,7 +1028,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1086,7 +1091,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1150,7 +1155,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1202,7 +1207,7 @@ def _deallocate_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1372,7 +1377,7 @@ def begin_deallocate( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1435,7 +1440,7 @@ def _delete_instances_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1596,7 +1601,7 @@ def begin_delete_instances( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1667,7 +1672,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1717,7 +1722,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1801,7 +1806,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1889,7 +1894,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1976,7 +1981,7 @@ def _power_off_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2146,7 +2151,7 @@ def begin_power_off( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2209,7 +2214,7 @@ def _restart_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2373,7 +2378,7 @@ def begin_restart( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2436,7 +2441,7 @@ def _start_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2600,7 +2605,7 @@ def begin_start( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2663,7 +2668,7 @@ def _update_instances_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2824,7 +2829,7 @@ def begin_update_instances( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2887,7 +2892,7 @@ def _reimage_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3051,7 +3056,7 @@ def begin_reimage( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3114,7 +3119,7 @@ def _reimage_all_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3281,7 +3286,7 @@ def begin_reimage_all( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py index 84d53529b2b1..ee5d66cec6bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py index 25b2beee1fc1..037c47f65f7b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_get_extensions_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +108,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -169,7 +174,7 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,12 +200,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -233,7 +243,7 @@ def build_instance_view_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -264,7 +274,7 @@ def build_convert_to_managed_disks_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -295,7 +305,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -326,7 +336,7 @@ def build_generalize_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -355,7 +365,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -383,7 +393,7 @@ def build_list_all_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -409,7 +419,7 @@ def build_list_available_sizes_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -438,7 +448,7 @@ def build_power_off_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -467,7 +477,7 @@ def build_restart_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -496,7 +506,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -525,7 +535,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -556,7 +566,7 @@ def build_perform_maintenance_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -587,7 +597,7 @@ def build_run_command_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -662,7 +672,7 @@ def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -712,7 +722,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -798,7 +808,7 @@ def _capture_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -958,7 +968,7 @@ def begin_capture( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1017,7 +1027,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1169,7 +1179,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1226,7 +1236,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1289,7 +1299,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1331,7 +1341,7 @@ def get_long_running_output(pipeline_response): @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1358,7 +1368,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1419,7 +1429,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1467,7 +1477,7 @@ def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -1531,7 +1541,7 @@ def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1587,7 +1597,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1651,7 +1661,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1717,7 +1727,7 @@ def generalize(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1766,7 +1776,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1847,7 +1857,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1933,7 +1943,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2016,7 +2026,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -2080,7 +2090,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2136,7 +2146,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -2199,7 +2209,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2255,7 +2265,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -2318,7 +2328,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2374,7 +2384,7 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -2437,7 +2447,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2493,7 +2503,7 @@ def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -2556,7 +2566,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2612,7 +2622,7 @@ def _run_command_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2762,7 +2772,7 @@ def begin_run_command( _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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py index 066943e2f71f..bfcbef131689 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-09-01") # type: str + api_version = kwargs.pop("api_version", "2017-09-01") # type: Literal["2017-09-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json index 2e0a0b98fc5e..050912057f49 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json @@ -99,4 +99,4 @@ "operation_groups": { "resource_skus": "ResourceSkusOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py index 692c85d0007f..79f89dfe5c3f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-09-01") # type: str + api_version = kwargs.pop("api_version", "2017-09-01") # type: Literal["2017-09-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py index a44f191879ae..78d3ff7d4245 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._resource_skus_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,7 +70,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-09-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-09-01")) # type: Literal["2017-09-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py index 9bbe26e3db0c..dff654ca25be 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2017-09-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-09-01")) # type: Literal["2017-09-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +96,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-09-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-09-01")) # type: Literal["2017-09-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py index ea649d379066..eadc9a983a66 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-12-01") # type: str + api_version = kwargs.pop("api_version", "2017-12-01") # type: Literal["2017-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json index 11a3de0d89c0..e5a228119a92 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json @@ -113,4 +113,4 @@ "log_analytics": "LogAnalyticsOperations", "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py index 6ad82f6e77f3..99662f4a3834 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-12-01") # type: str + api_version = kwargs.pop("api_version", "2017-12-01") # type: Literal["2017-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py index 1b779157a9ac..b12f8c3ddcac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -419,7 +424,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -471,7 +476,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -554,7 +559,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -642,7 +647,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py index 129ebab96de4..00fd18aaa9d7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -551,7 +556,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -619,7 +624,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -668,7 +673,7 @@ 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py index 512af81b4478..40c72d80a031 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py index 73938cda55d1..76c38e2abd1f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py index 2ec245793bb0..ac116be6253f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py index a8e5ddde84a3..5612e87c320d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py index b328bfeefee2..dee3e3dd783f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -251,7 +256,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -486,7 +491,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -544,7 +549,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -611,7 +616,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -687,7 +692,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py index 2a45a5cb7715..cc77bebda8dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py index 1472c4a60ec6..e01466ae590c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 45ed31b9540b..0b672ade2e8a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -380,7 +385,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -456,7 +461,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -512,7 +517,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 6123bea9fde5..37117cbdeb96 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ async def _cancel_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_cancel_request( @@ -133,7 +138,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -190,7 +195,7 @@ async def _start_os_upgrade_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_os_upgrade_request( @@ -255,7 +260,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -324,7 +329,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 79ae3b7e84e6..1d639f821b34 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,6 +47,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -149,7 +154,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -207,7 +212,7 @@ async def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -274,7 +279,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -332,7 +337,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -400,7 +405,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -463,7 +468,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -637,7 +642,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -695,7 +700,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -761,7 +766,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -830,7 +835,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -893,7 +898,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -964,7 +969,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1050,7 +1055,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1118,7 +1123,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1242,7 +1247,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1300,7 +1305,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1366,7 +1371,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1424,7 +1429,7 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1491,7 +1496,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1549,7 +1554,7 @@ async def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -1615,7 +1620,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py index 5127386dfb80..06a050df2790 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -252,7 +257,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -467,7 +472,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -524,7 +529,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -587,7 +592,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -653,7 +658,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -705,7 +710,7 @@ async def _deallocate_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -875,7 +880,7 @@ async def begin_deallocate( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -939,7 +944,7 @@ async def _delete_instances_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1100,7 +1105,7 @@ async def begin_delete_instances( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1172,7 +1177,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1222,7 +1227,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1306,7 +1311,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1394,7 +1399,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1483,7 +1488,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1570,7 +1575,7 @@ async def _power_off_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1740,7 +1745,7 @@ async def begin_power_off( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1804,7 +1809,7 @@ async def _restart_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1968,7 +1973,7 @@ async def begin_restart( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2032,7 +2037,7 @@ async def _start_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2196,7 +2201,7 @@ async def begin_start( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2260,7 +2265,7 @@ async def _redeploy_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2427,7 +2432,7 @@ async def begin_redeploy( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2491,7 +2496,7 @@ async def _perform_maintenance_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2664,7 +2669,7 @@ async def begin_perform_maintenance( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2728,7 +2733,7 @@ async def _update_instances_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2889,7 +2894,7 @@ async def begin_update_instances( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2953,7 +2958,7 @@ async def _reimage_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3117,7 +3122,7 @@ async def begin_reimage( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -3181,7 +3186,7 @@ async def _reimage_all_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3348,7 +3353,7 @@ async def begin_reimage_all( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -3424,7 +3429,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py index e8c7060201b0..8e1c059e5801 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py index f32c42489401..15d99dfdf023 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -104,7 +109,7 @@ async def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -155,7 +160,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -241,7 +246,7 @@ async def _capture_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -401,7 +406,7 @@ async def begin_capture( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -616,7 +621,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -673,7 +678,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -828,7 +833,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -885,7 +890,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -948,7 +953,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -990,7 +995,7 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1017,7 +1022,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1078,7 +1083,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1126,7 +1131,7 @@ async def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -1190,7 +1195,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1247,7 +1252,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1311,7 +1316,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1380,7 +1385,7 @@ async def generalize( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1430,7 +1435,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1512,7 +1517,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1599,7 +1604,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1682,7 +1687,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1746,7 +1751,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1866,7 +1871,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1923,7 +1928,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1986,7 +1991,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2043,7 +2048,7 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -2106,7 +2111,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2163,7 +2168,7 @@ async def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -2226,7 +2231,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2283,7 +2288,7 @@ async def _run_command_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2436,7 +2441,7 @@ async def begin_run_command( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_models_py3.py index 38c860e8848c..7619f69ea790 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -52,8 +57,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py index 13be5bb5ec16..8ed3ece4fd05 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_list_by_subscription_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -228,7 +233,7 @@ def build_list_available_sizes_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -362,7 +367,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -498,7 +503,7 @@ def 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -570,7 +575,7 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -630,7 +635,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -679,7 +684,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -761,7 +766,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -848,7 +853,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py index 1a21ee7524d4..0a69dd4a1c71 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_delete_request(resource_group_name: str, image_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,7 @@ 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -400,7 +405,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -457,7 +462,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -606,7 +611,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -663,7 +668,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -726,7 +731,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -794,7 +799,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -843,7 +848,7 @@ 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -924,7 +929,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py index 1c46fb240d90..8aaf7f430e76 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py index 0df387d912c0..f768dde7c395 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py index c42fb08d5b1b..4a1f550ea301 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py index d5de0e1700a9..c7fcc3452141 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py index 3be1cc1d12fd..17b9b9f887c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -391,7 +396,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -454,7 +459,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -626,7 +631,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -684,7 +689,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -751,7 +756,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -827,7 +832,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py index 08e1cc209a59..0e627f675de8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py index 90ced4f646ad..dbb381184640 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py index a6e5ab47248c..f3287e0866bc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,7 +122,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +156,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -390,7 +395,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -448,7 +453,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -515,7 +520,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -591,7 +596,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -647,7 +652,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 3adc6e819310..39a9f4f25bf2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_cancel_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_start_os_upgrade_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,7 @@ def build_get_latest_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def _cancel_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_cancel_request( @@ -225,7 +230,7 @@ def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -281,7 +286,7 @@ def _start_os_upgrade_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_os_upgrade_request( @@ -346,7 +351,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -414,7 +419,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py index b5f36f4e90ca..60a50dd23559 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_reimage_all_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +113,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -175,7 +180,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,7 +244,7 @@ def build_get_instance_view_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -278,7 +283,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -317,7 +322,7 @@ def build_power_off_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -349,7 +354,7 @@ def build_restart_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -381,7 +386,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -413,7 +418,7 @@ def build_redeploy_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -445,7 +450,7 @@ def build_perform_maintenance_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -504,7 +509,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -570,7 +575,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -627,7 +632,7 @@ def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -694,7 +699,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -751,7 +756,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -819,7 +824,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -881,7 +886,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1055,7 +1060,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1113,7 +1118,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1179,7 +1184,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1248,7 +1253,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1311,7 +1316,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1382,7 +1387,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1468,7 +1473,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1536,7 +1541,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1593,7 +1598,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1659,7 +1664,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1716,7 +1721,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1782,7 +1787,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1839,7 +1844,7 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1906,7 +1911,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1963,7 +1968,7 @@ def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -2029,7 +2034,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py index e7260bf56eec..4b0a83266e29 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -208,7 +213,7 @@ def build_delete_instances_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -242,7 +247,7 @@ def build_get_instance_view_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -299,7 +304,7 @@ def build_list_all_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +332,7 @@ def build_list_skus_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +363,7 @@ def build_get_os_upgrade_history_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -389,7 +394,7 @@ def build_power_off_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -423,7 +428,7 @@ def build_restart_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -457,7 +462,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -491,7 +496,7 @@ def build_redeploy_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -525,7 +530,7 @@ def build_perform_maintenance_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -559,7 +564,7 @@ def build_update_instances_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -593,7 +598,7 @@ def build_reimage_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -627,7 +632,7 @@ def build_reimage_all_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -666,7 +671,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -729,7 +734,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -887,7 +892,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -948,7 +953,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1102,7 +1107,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1159,7 +1164,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1222,7 +1227,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1286,7 +1291,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1338,7 +1343,7 @@ def _deallocate_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1508,7 +1513,7 @@ def begin_deallocate( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1571,7 +1576,7 @@ def _delete_instances_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1732,7 +1737,7 @@ def begin_delete_instances( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1803,7 +1808,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1853,7 +1858,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1937,7 +1942,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2025,7 +2030,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2114,7 +2119,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2201,7 +2206,7 @@ def _power_off_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2371,7 +2376,7 @@ def begin_power_off( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2434,7 +2439,7 @@ def _restart_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2598,7 +2603,7 @@ def begin_restart( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2661,7 +2666,7 @@ def _start_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2825,7 +2830,7 @@ def begin_start( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2888,7 +2893,7 @@ def _redeploy_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3055,7 +3060,7 @@ def begin_redeploy( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3118,7 +3123,7 @@ def _perform_maintenance_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3291,7 +3296,7 @@ def begin_perform_maintenance( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3354,7 +3359,7 @@ def _update_instances_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3515,7 +3520,7 @@ def begin_update_instances( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3578,7 +3583,7 @@ def _reimage_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3742,7 +3747,7 @@ def begin_reimage( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3805,7 +3810,7 @@ def _reimage_all_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3972,7 +3977,7 @@ def begin_reimage_all( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -4047,7 +4052,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py index 2ee19dbd8649..e35785c51c62 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py index 1100f9707dd3..40077ad134b1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_get_extensions_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +108,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -169,7 +174,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -201,7 +206,7 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -227,12 +232,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +275,7 @@ def build_instance_view_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -296,7 +306,7 @@ def build_convert_to_managed_disks_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +337,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_generalize_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -387,7 +397,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -415,7 +425,7 @@ def build_list_all_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -441,7 +451,7 @@ def build_list_available_sizes_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -470,7 +480,7 @@ def build_power_off_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -499,7 +509,7 @@ def build_restart_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -528,7 +538,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -557,7 +567,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -588,7 +598,7 @@ def build_perform_maintenance_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -619,7 +629,7 @@ def build_run_command_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -694,7 +704,7 @@ def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -744,7 +754,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -830,7 +840,7 @@ def _capture_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -990,7 +1000,7 @@ def begin_capture( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1049,7 +1059,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1201,7 +1211,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1258,7 +1268,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1410,7 +1420,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1467,7 +1477,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1530,7 +1540,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1572,7 +1582,7 @@ def get_long_running_output(pipeline_response): @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1599,7 +1609,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1660,7 +1670,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1708,7 +1718,7 @@ def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -1772,7 +1782,7 @@ def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1828,7 +1838,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1892,7 +1902,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1958,7 +1968,7 @@ def generalize(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -2007,7 +2017,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2088,7 +2098,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2174,7 +2184,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2257,7 +2267,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -2321,7 +2331,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2377,7 +2387,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -2440,7 +2450,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2496,7 +2506,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -2559,7 +2569,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2615,7 +2625,7 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -2678,7 +2688,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2734,7 +2744,7 @@ def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -2797,7 +2807,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2853,7 +2863,7 @@ def _run_command_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3003,7 +3013,7 @@ def begin_run_command( _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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py index 1fe24d8d44b6..0b1c65a15b2d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-04-01") # type: str + api_version = kwargs.pop("api_version", "2018-04-01") # type: Literal["2018-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json index ee5713600c62..31ae51a6807a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json @@ -116,4 +116,4 @@ "disks": "DisksOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py index cb4ddb3e065f..6c7cbf835579 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-04-01") # type: str + api_version = kwargs.pop("api_version", "2018-04-01") # type: Literal["2018-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py index 73fbf3a5e921..1d0d579f35c3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py index 64093b7d5009..ee1fac3a7203 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py index 8d562757817f..2d6a97e36648 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py index 13a446aa4296..6391240c0e36 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py index 08df0c289343..f9c06e368e0a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py index f14c520ea8f4..17c59b7a65b3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -470,7 +475,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -555,7 +560,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py index ff597d8af9fb..d1ab7dd3d599 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py index 5b85039f2d59..3c91bc9bab8c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py index e32b9de63c5f..dee67afdca77 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py index bea1cda140b3..1f4e99103d5f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py index 0da3c0d97abe..4321c8244e38 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py index 56d360de5250..58d907eb125a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 87ee1039f1be..7748695b19bc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -372,7 +377,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -446,7 +451,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -502,7 +507,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 753386ff3746..a38d4561f6f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ async def _cancel_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -125,7 +130,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -177,7 +182,7 @@ async def _start_os_upgrade_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -234,7 +239,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -298,7 +303,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index c793e5135636..c084c9ef0b18 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def _reimage_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -142,7 +147,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -195,7 +200,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -254,7 +259,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -307,7 +312,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -367,7 +372,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -425,7 +430,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -599,7 +604,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -657,7 +662,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -715,7 +720,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -782,7 +787,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -845,7 +850,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -916,7 +921,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1002,7 +1007,7 @@ async def _power_off_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1062,7 +1067,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1115,7 +1120,7 @@ async def _restart_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1173,7 +1178,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1226,7 +1231,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1284,7 +1289,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1337,7 +1342,7 @@ async def _redeploy_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1396,7 +1401,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1449,7 +1454,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1507,7 +1512,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1565,7 +1570,7 @@ async def _run_command_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.RunCommandResult]] @@ -1732,7 +1737,7 @@ async def begin_run_command( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py index 78cbcc502a62..0fa35e27086a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -252,7 +257,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -467,7 +472,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -524,7 +529,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -579,7 +584,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -643,7 +648,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -695,7 +700,7 @@ async def _deallocate_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -853,7 +858,7 @@ async def begin_deallocate( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -912,7 +917,7 @@ async def _delete_instances_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1061,7 +1066,7 @@ async def begin_delete_instances( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -1128,7 +1133,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1178,7 +1183,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1262,7 +1267,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1350,7 +1355,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1439,7 +1444,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1526,7 +1531,7 @@ async def _power_off_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1684,7 +1689,7 @@ async def begin_power_off( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -1743,7 +1748,7 @@ async def _restart_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1895,7 +1900,7 @@ async def begin_restart( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -1954,7 +1959,7 @@ async def _start_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2106,7 +2111,7 @@ async def begin_start( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -2165,7 +2170,7 @@ async def _redeploy_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2320,7 +2325,7 @@ async def begin_redeploy( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -2379,7 +2384,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2540,7 +2545,7 @@ async def begin_perform_maintenance( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -2599,7 +2604,7 @@ async def _update_instances_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2748,7 +2753,7 @@ async def begin_update_instances( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -2807,7 +2812,7 @@ async def _reimage_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2959,7 +2964,7 @@ async def begin_reimage( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -3018,7 +3023,7 @@ async def _reimage_all_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3173,7 +3178,7 @@ async def begin_reimage_all( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -3244,7 +3249,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py index 35386e927462..25e7e98714f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py index 1a67f6360c37..fab2faf086f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -52,6 +53,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -177,7 +182,7 @@ async def _capture_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.VirtualMachineCaptureResult]] @@ -337,7 +342,7 @@ async def begin_capture( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -396,7 +401,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -551,7 +556,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +613,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -763,7 +768,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -820,7 +825,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -873,7 +878,7 @@ async def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -913,7 +918,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -940,7 +945,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1001,7 +1006,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1049,7 +1054,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1105,7 +1110,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1157,7 +1162,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1211,7 +1216,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1275,7 +1280,7 @@ async def generalize( # 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1321,7 +1326,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1403,7 +1408,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1490,7 +1495,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1573,7 +1578,7 @@ async def _power_off_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1627,7 +1632,7 @@ async def begin_power_off(self, resource_group_name: str, vm_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1679,7 +1684,7 @@ async def _restart_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1732,7 +1737,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1784,7 +1789,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1837,7 +1842,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1889,7 +1894,7 @@ async def _redeploy_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1942,7 +1947,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1994,7 +1999,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2049,7 +2054,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2101,7 +2106,7 @@ async def _run_command_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.RunCommandResult]] @@ -2254,7 +2259,7 @@ async def begin_run_command( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_models_py3.py index 73f732916089..6ca9de909e36 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -75,8 +80,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py index feea11ad9042..19c2b5b8310f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py index 797913280872..685853b969a5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py index 216b39ec33f5..293f2c0f5eb6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py index 8a0ad176ce0b..f5ec93c91cbc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py index 4aaca8691b5f..d4adc3461e92 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py index 9e0cd881c546..8a3961b773c6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -141,7 +146,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -333,7 +338,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -475,7 +480,7 @@ def 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -547,7 +552,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -603,7 +608,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -651,7 +656,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -736,7 +741,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py index cccdf59898e5..fbc30a946ff7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py index f4bdb1831615..3350168f96c9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py index 2e414ea92e79..9fd9954fe04c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py index 39f8f98c3cbe..cc9abf84b4d0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py index 9742a523b957..8fd1b0c05fe2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py index 17418514497d..aceb9e75cc13 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py index 2b0fda114358..51260f2058d5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -111,7 +116,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +150,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -384,7 +389,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -442,7 +447,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -501,7 +506,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -575,7 +580,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -631,7 +636,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 153e77fba5c7..1f3f8530f271 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -92,7 +97,7 @@ def build_get_latest_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ def _cancel_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -203,7 +208,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -255,7 +260,7 @@ def _start_os_upgrade_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -312,7 +317,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -376,7 +381,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py index 479f6274c370..650006e622e4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_reimage_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -69,7 +74,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -95,7 +100,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -122,7 +127,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -156,7 +161,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +188,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_get_instance_view_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,7 +259,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -292,7 +297,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -318,7 +323,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -344,7 +349,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -370,7 +375,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -396,7 +401,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -423,7 +428,7 @@ def build_run_command_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -485,7 +490,7 @@ def _reimage_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -543,7 +548,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -596,7 +601,7 @@ def _reimage_all_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -655,7 +660,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -708,7 +713,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -768,7 +773,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1000,7 +1005,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1058,7 +1063,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1116,7 +1121,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1183,7 +1188,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1246,7 +1251,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1317,7 +1322,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1403,7 +1408,7 @@ def _power_off_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1463,7 +1468,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1516,7 +1521,7 @@ def _restart_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1574,7 +1579,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1627,7 +1632,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1685,7 +1690,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1738,7 +1743,7 @@ def _redeploy_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1797,7 +1802,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1850,7 +1855,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1908,7 +1913,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1966,7 +1971,7 @@ def _run_command_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.RunCommandResult]] @@ -2130,7 +2135,7 @@ def begin_run_command( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py index 11ce71617a7c..bc33ca83b711 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -377,7 +382,7 @@ def build_power_off_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -408,7 +413,7 @@ def build_restart_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -439,7 +444,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -470,7 +475,7 @@ def build_redeploy_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -501,7 +506,7 @@ def build_perform_maintenance_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -532,7 +537,7 @@ def build_update_instances_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -563,7 +568,7 @@ def build_reimage_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -594,7 +599,7 @@ def build_reimage_all_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -630,7 +635,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -693,7 +698,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -851,7 +856,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -912,7 +917,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1066,7 +1071,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1123,7 +1128,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1176,7 +1181,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1238,7 +1243,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1290,7 +1295,7 @@ def _deallocate_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1448,7 +1453,7 @@ def begin_deallocate( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -1507,7 +1512,7 @@ def _delete_instances_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1656,7 +1661,7 @@ def begin_delete_instances( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -1723,7 +1728,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1773,7 +1778,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1857,7 +1862,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1945,7 +1950,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2034,7 +2039,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2121,7 +2126,7 @@ def _power_off_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2279,7 +2284,7 @@ def begin_power_off( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -2338,7 +2343,7 @@ def _restart_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2490,7 +2495,7 @@ def begin_restart( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -2549,7 +2554,7 @@ def _start_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2701,7 +2706,7 @@ def begin_start( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -2760,7 +2765,7 @@ def _redeploy_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2915,7 +2920,7 @@ def begin_redeploy( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -2974,7 +2979,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3135,7 +3140,7 @@ def begin_perform_maintenance( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -3194,7 +3199,7 @@ def _update_instances_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3343,7 +3348,7 @@ def begin_update_instances( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -3402,7 +3407,7 @@ def _reimage_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3554,7 +3559,7 @@ def begin_reimage( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -3613,7 +3618,7 @@ def _reimage_all_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3768,7 +3773,7 @@ def begin_reimage_all( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] 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] @@ -3839,7 +3844,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py index dd81e61a0053..c5527d3c0a6e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py index c6085e0084de..d4faaa44bf51 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -384,7 +394,7 @@ def build_list_available_sizes_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -412,7 +422,7 @@ def build_list_available_sizes_request( def build_power_off_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -435,7 +445,7 @@ def build_power_off_request(resource_group_name: str, vm_name: str, subscription def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -458,7 +468,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -481,7 +491,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -506,7 +516,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -532,7 +542,7 @@ def build_run_command_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -594,7 +604,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -680,7 +690,7 @@ def _capture_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.VirtualMachineCaptureResult]] @@ -840,7 +850,7 @@ def begin_capture( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -899,7 +909,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1051,7 +1061,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1108,7 +1118,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1260,7 +1270,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1317,7 +1327,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1370,7 +1380,7 @@ def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1410,7 +1420,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1437,7 +1447,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1498,7 +1508,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1546,7 +1556,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1600,7 +1610,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1652,7 +1662,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1706,7 +1716,7 @@ def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1770,7 +1780,7 @@ def generalize( # 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1815,7 +1825,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1896,7 +1906,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1982,7 +1992,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2065,7 +2075,7 @@ def _power_off_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2119,7 +2129,7 @@ def begin_power_off(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2171,7 +2181,7 @@ def _restart_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2224,7 +2234,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2276,7 +2286,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2329,7 +2339,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2381,7 +2391,7 @@ def _redeploy_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2434,7 +2444,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2486,7 +2496,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2539,7 +2549,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2591,7 +2601,7 @@ def _run_command_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-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.RunCommandResult]] @@ -2741,7 +2751,7 @@ def begin_run_command( _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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py index 373836347d12..737d1cfc17a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-06-01") # type: str + api_version = kwargs.pop("api_version", "2018-06-01") # type: Literal["2018-06-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json index c6a5084f44cd..0011fc440d6f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json @@ -119,4 +119,4 @@ "disks": "DisksOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py index 4a5c0ec02d3c..a7424de66fe6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-06-01") # type: str + api_version = kwargs.pop("api_version", "2018-06-01") # type: Literal["2018-06-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py index 6593f353297b..f6f63ca78c4a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py index b7ab2e3e848b..f2c29e01269e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py index a61b92476f6c..d2c0d51fc295 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -238,7 +243,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -305,7 +310,7 @@ async def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -353,7 +358,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -406,7 +411,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -458,7 +463,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -538,7 +543,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py index 7df3795e5eb8..5131a6a9a72e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_image_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -279,7 +284,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -366,7 +371,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -422,7 +427,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -491,7 +496,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -554,7 +559,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py index 1cc48f5c6ed5..37e37945efb5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -259,7 +264,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -332,7 +337,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -381,7 +386,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -440,7 +445,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -499,7 +504,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py index 9551357f3906..f835f9cb19b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py index 7a45fdd20ee1..ed8cac9d2b83 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py index 1b35e883a7d7..b56b5c978c21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py index 25f2c75a4f79..67625bca7bb3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -470,7 +475,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -555,7 +560,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py index ed743a0788dc..1f18aa2b529c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py index c7f282ca61f0..820d41847200 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py index 680fa304eb9e..71f1f2bc1c39 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py index 5488bd2c61e4..8e32239210fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py index c29e514a0fdb..b556b88ca429 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py index 5ae8e73f42ec..fe354439defc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 7bebaf531c77..aea7640e9e1a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -372,7 +377,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -446,7 +451,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -502,7 +507,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 51f5b4ab8c97..2fc9018476ec 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 7fc13aa31fdc..fcae5856dde0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def _reimage_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -251,7 +256,7 @@ async def begin_reimage( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -307,7 +312,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -366,7 +371,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -479,7 +484,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -537,7 +542,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -711,7 +716,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -769,7 +774,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -827,7 +832,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -957,7 +962,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1028,7 +1033,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1114,7 +1119,7 @@ async def _power_off_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1174,7 +1179,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1227,7 +1232,7 @@ async def _restart_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1285,7 +1290,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1338,7 +1343,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1396,7 +1401,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1449,7 +1454,7 @@ async def _redeploy_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1508,7 +1513,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1561,7 +1566,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1619,7 +1624,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1677,7 +1682,7 @@ async def _run_command_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -1844,7 +1849,7 @@ async def begin_run_command( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py index 8413bd9dd4a6..593af2afb692 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -252,7 +257,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -467,7 +472,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -524,7 +529,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -579,7 +584,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -643,7 +648,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -695,7 +700,7 @@ async def _deallocate_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -853,7 +858,7 @@ async def begin_deallocate( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -912,7 +917,7 @@ async def _delete_instances_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1061,7 +1066,7 @@ async def begin_delete_instances( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -1128,7 +1133,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1178,7 +1183,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1262,7 +1267,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1350,7 +1355,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1439,7 +1444,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1526,7 +1531,7 @@ async def _power_off_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1684,7 +1689,7 @@ async def begin_power_off( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -1743,7 +1748,7 @@ async def _restart_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1895,7 +1900,7 @@ async def begin_restart( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -1954,7 +1959,7 @@ async def _start_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2106,7 +2111,7 @@ async def begin_start( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -2165,7 +2170,7 @@ async def _redeploy_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2320,7 +2325,7 @@ async def begin_redeploy( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -2379,7 +2384,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2540,7 +2545,7 @@ async def begin_perform_maintenance( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -2599,7 +2604,7 @@ async def _update_instances_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2748,7 +2753,7 @@ async def begin_update_instances( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -2807,7 +2812,7 @@ async def _reimage_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2963,7 +2968,7 @@ async def begin_reimage( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -3022,7 +3027,7 @@ async def _reimage_all_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3177,7 +3182,7 @@ async def begin_reimage_all( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -3248,7 +3253,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py index 45056dd39fa7..a34cc0c9ccd4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py index b07624206f35..f078a54a22be 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -178,7 +183,7 @@ async def _capture_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -338,7 +343,7 @@ async def begin_capture( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -397,7 +402,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -552,7 +557,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -609,7 +614,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -764,7 +769,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -821,7 +826,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -874,7 +879,7 @@ async def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -914,7 +919,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -941,7 +946,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1002,7 +1007,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1050,7 +1055,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1106,7 +1111,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1158,7 +1163,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1212,7 +1217,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1276,7 +1281,7 @@ async def generalize( # 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1322,7 +1327,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1404,7 +1409,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1491,7 +1496,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1574,7 +1579,7 @@ async def _power_off_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1628,7 +1633,7 @@ async def begin_power_off(self, resource_group_name: str, vm_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1680,7 +1685,7 @@ async def _restart_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1733,7 +1738,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1785,7 +1790,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1838,7 +1843,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1890,7 +1895,7 @@ async def _redeploy_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1943,7 +1948,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1999,7 +2004,7 @@ async def _reimage_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2149,7 +2154,7 @@ async def begin_reimage( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -2204,7 +2209,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2259,7 +2264,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2311,7 +2316,7 @@ async def _run_command_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2464,7 +2469,7 @@ async def begin_run_command( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py index a5ac73d8bebe..b669defda5b8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -101,8 +106,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py index 6eca00470425..9963a939a873 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py index 0dfb8a88b407..b938732ec096 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py index 591552dd0068..7624cf3080db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_get_request(resource_group_name: str, gallery_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +222,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -377,7 +382,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -444,7 +449,7 @@ def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -492,7 +497,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -545,7 +550,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -597,7 +602,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -677,7 +682,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py index 069e842ff417..2e86bfaabe6c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,7 +170,7 @@ def build_list_by_gallery_image_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,7 +235,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -429,7 +434,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -572,7 +577,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -641,7 +646,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -704,7 +709,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py index 7ac178d382ea..ac4e7f7652ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_list_by_gallery_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -386,7 +391,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -459,7 +464,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -508,7 +513,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -567,7 +572,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -625,7 +630,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py index a8758da0f9bc..65602fba631e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py index 6cc17a2e8ae3..72c1dc239169 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py index be65f42f9672..4fb473994f60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py index aeae1e0064f3..3907aaa62f2f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -141,7 +146,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -333,7 +338,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -475,7 +480,7 @@ def 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -547,7 +552,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -603,7 +608,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -651,7 +656,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -736,7 +741,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py index a842021ab277..87ccc53d1565 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py index 57a0f0ed0a8a..3376be30ccf4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py index 53e7f1e8f85e..5d5f499d7086 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py index 4ca446f4fa69..3f702ef35cca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py index 9645ce299216..8b8bf6ca4b31 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py index 089097ad29a8..7688ea7aafa7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py index 87db8aa34e41..d1f18fead385 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -111,7 +116,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +150,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -384,7 +389,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -442,7 +447,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -501,7 +506,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -575,7 +580,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -631,7 +636,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index d374094f0de4..4732f296bf28 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py index cac387e8a425..b02ca7d8cfa6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,7 +194,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -221,7 +226,7 @@ def build_get_instance_view_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +265,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -298,7 +303,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -324,7 +329,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -350,7 +355,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -376,7 +381,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -402,7 +407,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -429,7 +434,7 @@ def build_run_command_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -496,7 +501,7 @@ def _reimage_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -658,7 +663,7 @@ def begin_reimage( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -714,7 +719,7 @@ def _reimage_all_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -773,7 +778,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -886,7 +891,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -944,7 +949,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1118,7 +1123,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1176,7 +1181,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1234,7 +1239,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1301,7 +1306,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1364,7 +1369,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1435,7 +1440,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1521,7 +1526,7 @@ def _power_off_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1581,7 +1586,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1634,7 +1639,7 @@ def _restart_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1692,7 +1697,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1745,7 +1750,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1803,7 +1808,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1856,7 +1861,7 @@ def _redeploy_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1915,7 +1920,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1968,7 +1973,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2026,7 +2031,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2084,7 +2089,7 @@ def _run_command_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2248,7 +2253,7 @@ def begin_run_command( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py index 24d600ec9000..50e2f35a2d58 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -377,7 +382,7 @@ def build_power_off_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -408,7 +413,7 @@ def build_restart_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -439,7 +444,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -470,7 +475,7 @@ def build_redeploy_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -501,7 +506,7 @@ def build_perform_maintenance_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -532,7 +537,7 @@ def build_update_instances_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -563,7 +568,7 @@ def build_reimage_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -594,7 +599,7 @@ def build_reimage_all_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -630,7 +635,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -693,7 +698,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -851,7 +856,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -912,7 +917,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1066,7 +1071,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1123,7 +1128,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1176,7 +1181,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1238,7 +1243,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1290,7 +1295,7 @@ def _deallocate_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1448,7 +1453,7 @@ def begin_deallocate( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -1507,7 +1512,7 @@ def _delete_instances_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1656,7 +1661,7 @@ def begin_delete_instances( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -1723,7 +1728,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1773,7 +1778,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1857,7 +1862,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1945,7 +1950,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2034,7 +2039,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2121,7 +2126,7 @@ def _power_off_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2279,7 +2284,7 @@ def begin_power_off( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -2338,7 +2343,7 @@ def _restart_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2490,7 +2495,7 @@ def begin_restart( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -2549,7 +2554,7 @@ def _start_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2701,7 +2706,7 @@ def begin_start( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -2760,7 +2765,7 @@ def _redeploy_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2915,7 +2920,7 @@ def begin_redeploy( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -2974,7 +2979,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3135,7 +3140,7 @@ def begin_perform_maintenance( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -3194,7 +3199,7 @@ def _update_instances_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3343,7 +3348,7 @@ def begin_update_instances( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -3402,7 +3407,7 @@ def _reimage_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3558,7 +3563,7 @@ def begin_reimage( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -3617,7 +3622,7 @@ def _reimage_all_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3772,7 +3777,7 @@ def begin_reimage_all( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -3843,7 +3848,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py index bc12cc1da7b3..b53809e20918 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py index bd4d87e2f7fc..5587faa88993 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -384,7 +394,7 @@ def build_list_available_sizes_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -412,7 +422,7 @@ def build_list_available_sizes_request( def build_power_off_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -435,7 +445,7 @@ def build_power_off_request(resource_group_name: str, vm_name: str, subscription def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -458,7 +468,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -481,7 +491,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -505,7 +515,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -535,7 +545,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -561,7 +571,7 @@ def build_run_command_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -623,7 +633,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -709,7 +719,7 @@ def _capture_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -869,7 +879,7 @@ def begin_capture( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -928,7 +938,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1080,7 +1090,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1137,7 +1147,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1289,7 +1299,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1346,7 +1356,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1399,7 +1409,7 @@ def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1439,7 +1449,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1466,7 +1476,7 @@ 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1527,7 +1537,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1575,7 +1585,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1629,7 +1639,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1681,7 +1691,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1735,7 +1745,7 @@ def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1799,7 +1809,7 @@ def generalize( # 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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1844,7 +1854,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1925,7 +1935,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2011,7 +2021,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2094,7 +2104,7 @@ def _power_off_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2148,7 +2158,7 @@ def begin_power_off(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2200,7 +2210,7 @@ def _restart_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2253,7 +2263,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2305,7 +2315,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2358,7 +2368,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2410,7 +2420,7 @@ def _redeploy_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2463,7 +2473,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2519,7 +2529,7 @@ def _reimage_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2669,7 +2679,7 @@ def begin_reimage( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] 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] @@ -2724,7 +2734,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2777,7 +2787,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2829,7 +2839,7 @@ def _run_command_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2979,7 +2989,7 @@ def begin_run_command( _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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py index 6ac5110689ff..a9bbc0468cff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-09-30") # type: str + api_version = kwargs.pop("api_version", "2018-09-30") # type: Literal["2018-09-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json index 3f23cefeeea3..32e7800b37f8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json @@ -100,4 +100,4 @@ "disks": "DisksOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py index 4b8c7c0352d5..0358499f46a6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-09-30") # type: str + api_version = kwargs.pop("api_version", "2018-09-30") # type: Literal["2018-09-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py index 42d4f5a357d3..c763eedb9a50 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py index 140b9b5da717..229592ba0bca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py index fc58d7f90b2d..e8900b1b948e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py index 111b5484dbf1..e62cd155197e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py index c438b4d50439..a29250890767 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-10-01") # type: str + api_version = kwargs.pop("api_version", "2018-10-01") # type: Literal["2018-10-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json index de9718e9c1e6..2696f24168be 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json @@ -114,4 +114,4 @@ "log_analytics": "LogAnalyticsOperations", "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py index 55ba5b0ab43a..1ac7a939dd43 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-10-01") # type: str + api_version = kwargs.pop("api_version", "2018-10-01") # type: Literal["2018-10-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py index 223cea3b5e5b..9feb9691d992 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py index e3d1a46969a7..45df08237502 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py index d0c33fd94aa2..209b5f099371 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py index 111e7b6ba794..ff6f524ededa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py index 41f8dc758df1..7b1c9f8517c2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -470,7 +475,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -555,7 +560,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py index 6322635fa3a2..43608759be27 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py index c9ffa47c6ee3..f2b11b1eed46 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py index e856624ae200..565a4d297a44 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py index 2cacd805dd3f..899adcb7d34b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py index 1c219a11c563..38993fbc22c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index a265e587d639..efee2cc34c32 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -372,7 +377,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -446,7 +451,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -502,7 +507,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 14c43806dc49..6a50b2283c2c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 9b4059ae5cc2..8cc75c50fca3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def _reimage_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -251,7 +256,7 @@ async def begin_reimage( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -307,7 +312,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -366,7 +371,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -479,7 +484,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -537,7 +542,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -711,7 +716,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -769,7 +774,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -827,7 +832,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -957,7 +962,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1028,7 +1033,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1114,7 +1119,7 @@ async def _power_off_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1174,7 +1179,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1227,7 +1232,7 @@ async def _restart_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1285,7 +1290,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1338,7 +1343,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1396,7 +1401,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1449,7 +1454,7 @@ async def _redeploy_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1508,7 +1513,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1561,7 +1566,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1619,7 +1624,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1677,7 +1682,7 @@ async def _run_command_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -1844,7 +1849,7 @@ async def begin_run_command( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py index c7187431aacc..1a69e55e81cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -252,7 +257,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -467,7 +472,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -524,7 +529,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -579,7 +584,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -643,7 +648,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -695,7 +700,7 @@ async def _deallocate_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -853,7 +858,7 @@ async def begin_deallocate( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -912,7 +917,7 @@ async def _delete_instances_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1061,7 +1066,7 @@ async def begin_delete_instances( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -1128,7 +1133,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1178,7 +1183,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1262,7 +1267,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1350,7 +1355,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1439,7 +1444,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1526,7 +1531,7 @@ async def _power_off_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1684,7 +1689,7 @@ async def begin_power_off( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -1743,7 +1748,7 @@ async def _restart_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1895,7 +1900,7 @@ async def begin_restart( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -1954,7 +1959,7 @@ async def _start_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2106,7 +2111,7 @@ async def begin_start( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -2165,7 +2170,7 @@ async def _redeploy_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2320,7 +2325,7 @@ async def begin_redeploy( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -2379,7 +2384,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2540,7 +2545,7 @@ async def begin_perform_maintenance( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -2599,7 +2604,7 @@ async def _update_instances_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2748,7 +2753,7 @@ async def begin_update_instances( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -2807,7 +2812,7 @@ async def _reimage_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2963,7 +2968,7 @@ async def begin_reimage( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -3022,7 +3027,7 @@ async def _reimage_all_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3177,7 +3182,7 @@ async def begin_reimage_all( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -3248,7 +3253,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py index fd39f78e4170..e4af4f5f6266 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py index 164cda974441..23c4d6eb8e7b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -178,7 +183,7 @@ async def _capture_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -338,7 +343,7 @@ async def begin_capture( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -397,7 +402,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -552,7 +557,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -609,7 +614,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -764,7 +769,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -821,7 +826,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -874,7 +879,7 @@ async def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -914,7 +919,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -941,7 +946,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1002,7 +1007,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1050,7 +1055,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1106,7 +1111,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1158,7 +1163,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1212,7 +1217,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1276,7 +1281,7 @@ async def generalize( # 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1322,7 +1327,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1404,7 +1409,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1491,7 +1496,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1574,7 +1579,7 @@ async def _power_off_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1628,7 +1633,7 @@ async def begin_power_off(self, resource_group_name: str, vm_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1680,7 +1685,7 @@ async def _restart_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1733,7 +1738,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1785,7 +1790,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1838,7 +1843,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1890,7 +1895,7 @@ async def _redeploy_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1943,7 +1948,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1999,7 +2004,7 @@ async def _reimage_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2149,7 +2154,7 @@ async def begin_reimage( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -2204,7 +2209,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2259,7 +2264,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2311,7 +2316,7 @@ async def _run_command_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2464,7 +2469,7 @@ async def begin_run_command( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py index a04eab44c796..cc7456d2b76f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -78,8 +83,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py index 91118c6b45e6..99ddde42a27e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py index 8047ad425e5a..805fda8e361a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py index 78eed1e37740..fb3c3771cb27 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py index 23a99f9862c3..cccefb211d8d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py index 881fa46b802d..14a01bbbaa24 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -141,7 +146,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -333,7 +338,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -475,7 +480,7 @@ def 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -547,7 +552,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -603,7 +608,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -651,7 +656,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -736,7 +741,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py index 308743e6740f..7f4a140cca92 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py index 3d8e5e178b57..fb0be7c30559 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py index f6c718492a69..5f93263cbac3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py index 5c9ec3fc8164..dc5cc0ab2595 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py index 94a98153bee0..04b4ef6b4683 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py index 62cd284c2da4..7ed2c4511e58 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -111,7 +116,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +150,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -384,7 +389,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -442,7 +447,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -501,7 +506,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -575,7 +580,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -631,7 +636,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 835bf632d0f0..e719b6c42ac5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py index 8b52e471941d..d02013919041 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,7 +194,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -221,7 +226,7 @@ def build_get_instance_view_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +265,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -298,7 +303,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -324,7 +329,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -350,7 +355,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -376,7 +381,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -402,7 +407,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -429,7 +434,7 @@ def build_run_command_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -496,7 +501,7 @@ def _reimage_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -658,7 +663,7 @@ def begin_reimage( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -714,7 +719,7 @@ def _reimage_all_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -773,7 +778,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -886,7 +891,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -944,7 +949,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1118,7 +1123,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1176,7 +1181,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1234,7 +1239,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1301,7 +1306,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1364,7 +1369,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1435,7 +1440,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1521,7 +1526,7 @@ def _power_off_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1581,7 +1586,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1634,7 +1639,7 @@ def _restart_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1692,7 +1697,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1745,7 +1750,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1803,7 +1808,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1856,7 +1861,7 @@ def _redeploy_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1915,7 +1920,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1968,7 +1973,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2026,7 +2031,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2084,7 +2089,7 @@ def _run_command_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2248,7 +2253,7 @@ def begin_run_command( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py index bfe5c314504c..b75b1138d96f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -377,7 +382,7 @@ def build_power_off_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -408,7 +413,7 @@ def build_restart_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -439,7 +444,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -470,7 +475,7 @@ def build_redeploy_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -501,7 +506,7 @@ def build_perform_maintenance_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -532,7 +537,7 @@ def build_update_instances_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -563,7 +568,7 @@ def build_reimage_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -594,7 +599,7 @@ def build_reimage_all_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -630,7 +635,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -693,7 +698,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -851,7 +856,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -912,7 +917,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1066,7 +1071,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1123,7 +1128,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1176,7 +1181,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1238,7 +1243,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1290,7 +1295,7 @@ def _deallocate_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1448,7 +1453,7 @@ def begin_deallocate( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -1507,7 +1512,7 @@ def _delete_instances_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1656,7 +1661,7 @@ def begin_delete_instances( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -1723,7 +1728,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1773,7 +1778,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1857,7 +1862,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1945,7 +1950,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2034,7 +2039,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2121,7 +2126,7 @@ def _power_off_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2279,7 +2284,7 @@ def begin_power_off( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -2338,7 +2343,7 @@ def _restart_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2490,7 +2495,7 @@ def begin_restart( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -2549,7 +2554,7 @@ def _start_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2701,7 +2706,7 @@ def begin_start( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -2760,7 +2765,7 @@ def _redeploy_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2915,7 +2920,7 @@ def begin_redeploy( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -2974,7 +2979,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3135,7 +3140,7 @@ def begin_perform_maintenance( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -3194,7 +3199,7 @@ def _update_instances_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3343,7 +3348,7 @@ def begin_update_instances( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -3402,7 +3407,7 @@ def _reimage_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3558,7 +3563,7 @@ def begin_reimage( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -3617,7 +3622,7 @@ def _reimage_all_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3772,7 +3777,7 @@ def begin_reimage_all( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -3843,7 +3848,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py index ba9796b0f54a..8715f0b158ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py index 55394855856a..fe0765402991 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -384,7 +394,7 @@ def build_list_available_sizes_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -412,7 +422,7 @@ def build_list_available_sizes_request( def build_power_off_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -435,7 +445,7 @@ def build_power_off_request(resource_group_name: str, vm_name: str, subscription def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -458,7 +468,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -481,7 +491,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -505,7 +515,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -535,7 +545,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -561,7 +571,7 @@ def build_run_command_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -623,7 +633,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -709,7 +719,7 @@ def _capture_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -869,7 +879,7 @@ def begin_capture( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -928,7 +938,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1080,7 +1090,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1137,7 +1147,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1289,7 +1299,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1346,7 +1356,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1399,7 +1409,7 @@ def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1439,7 +1449,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1466,7 +1476,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1527,7 +1537,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1575,7 +1585,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1629,7 +1639,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1681,7 +1691,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1735,7 +1745,7 @@ def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1799,7 +1809,7 @@ def generalize( # 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1844,7 +1854,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1925,7 +1935,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2011,7 +2021,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2094,7 +2104,7 @@ def _power_off_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2148,7 +2158,7 @@ def begin_power_off(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2200,7 +2210,7 @@ def _restart_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2253,7 +2263,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2305,7 +2315,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2358,7 +2368,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2410,7 +2420,7 @@ def _redeploy_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2463,7 +2473,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2519,7 +2529,7 @@ def _reimage_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2669,7 +2679,7 @@ def begin_reimage( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] 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] @@ -2724,7 +2734,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2777,7 +2787,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2829,7 +2839,7 @@ def _run_command_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2979,7 +2989,7 @@ def begin_run_command( _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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py index 2c2732526ace..3fd767ddf7de 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-03-01") # type: str + api_version = kwargs.pop("api_version", "2019-03-01") # type: Literal["2019-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json index 986dbf89db79..7c2c9590aecb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json @@ -123,4 +123,4 @@ "disks": "DisksOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py index 9caf399bf93c..1943ffb9d7e3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-03-01") # type: str + api_version = kwargs.pop("api_version", "2019-03-01") # type: Literal["2019-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py index bc5126907456..53b23d4a1277 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py index aa923d490a35..54d524fcdcb9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ async def get(self, resource_group_name: str, host_group_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -474,7 +479,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -556,7 +561,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py index a9441e70dde4..24202d079089 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -638,7 +643,7 @@ async def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -668,7 +673,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -724,7 +729,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py index bfaf02f77f27..05afb4be5377 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py index 02ab682dc57d..844946c75dbe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -238,7 +243,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -305,7 +310,7 @@ async def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -353,7 +358,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -406,7 +411,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -458,7 +463,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -538,7 +543,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py index 7ea2e9843465..3be368d6dea5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_application_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -281,7 +286,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -368,7 +373,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -424,7 +429,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -493,7 +498,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -557,7 +562,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py index 15f1653998ad..0ec0674600d5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -262,7 +267,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -336,7 +341,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -385,7 +390,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -445,7 +450,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -504,7 +509,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py index 8397ab3d1e54..80ed8b090abc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_image_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -279,7 +284,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -366,7 +371,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -422,7 +427,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -491,7 +496,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -554,7 +559,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py index 41bb749ba378..bd48b96c27d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -259,7 +264,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -332,7 +337,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -381,7 +386,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -440,7 +445,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -499,7 +504,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py index aa669d7e7d64..e9a093decde1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py index cd8f3bbfd4eb..6f0565a11965 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py index b2bbb9dc3a8a..58055160d40d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py index 425526935c35..7383de74cd41 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -470,7 +475,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -555,7 +560,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py index 6c7d0277ecfb..36dce4120ddd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py index 9f99f1a44d78..a7f5937a6ff2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py index 0d8cf811e0a1..12fa16767037 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py index d1de0d0ea5eb..eaf2eb39101f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py index aa1a4af9f7ba..8828bb992cf3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py index 6e3b04f1fb24..217836d7c1ba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 2bc49a91e4c4..9ead1a60bea4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -372,7 +377,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -446,7 +451,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -502,7 +507,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index add33333344f..67c93ff8d543 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index dfe1f7a9ab77..e6127dfa3a4e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def _reimage_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -251,7 +256,7 @@ async def begin_reimage( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -307,7 +312,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -366,7 +371,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -479,7 +484,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -537,7 +542,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -711,7 +716,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -769,7 +774,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -827,7 +832,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -872,7 +877,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -902,7 +907,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -966,7 +971,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1037,7 +1042,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1128,7 +1133,7 @@ async def _power_off_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1198,7 +1203,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1252,7 +1257,7 @@ async def _restart_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1310,7 +1315,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1363,7 +1368,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1421,7 +1426,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1479,7 @@ async def _redeploy_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1533,7 +1538,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1586,7 +1591,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1644,7 +1649,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1702,7 +1707,7 @@ async def _run_command_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -1869,7 +1874,7 @@ async def begin_run_command( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py index 60cc3c9f7626..7c807f82a4df 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -54,6 +55,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -253,7 +258,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -468,7 +473,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -525,7 +530,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -580,7 +585,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -644,7 +649,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -696,7 +701,7 @@ async def _deallocate_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -854,7 +859,7 @@ async def begin_deallocate( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -913,7 +918,7 @@ async def _delete_instances_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1062,7 +1067,7 @@ async def begin_delete_instances( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -1129,7 +1134,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1179,7 +1184,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1263,7 +1268,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1351,7 +1356,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1440,7 +1445,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1528,7 +1533,7 @@ async def _power_off_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1702,7 +1707,7 @@ async def begin_power_off( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -1762,7 +1767,7 @@ async def _restart_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1914,7 +1919,7 @@ async def begin_restart( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -1973,7 +1978,7 @@ async def _start_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2125,7 +2130,7 @@ async def begin_start( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -2184,7 +2189,7 @@ async def _redeploy_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2339,7 +2344,7 @@ async def begin_redeploy( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -2398,7 +2403,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2559,7 +2564,7 @@ async def begin_perform_maintenance( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -2618,7 +2623,7 @@ async def _update_instances_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2767,7 +2772,7 @@ async def begin_update_instances( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -2826,7 +2831,7 @@ async def _reimage_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2982,7 +2987,7 @@ async def begin_reimage( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -3041,7 +3046,7 @@ async def _reimage_all_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3196,7 +3201,7 @@ async def begin_reimage_all( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -3267,7 +3272,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3397,7 +3402,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py index 3e19fa0aa718..8ae6a0aaaaa5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py index fb01a1949ff1..8ef363e4dc32 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -178,7 +183,7 @@ async def _capture_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -338,7 +343,7 @@ async def begin_capture( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -397,7 +402,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -552,7 +557,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -609,7 +614,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -764,7 +769,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -821,7 +826,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -874,7 +879,7 @@ async def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -914,7 +919,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -941,7 +946,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1002,7 +1007,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1050,7 +1055,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1106,7 +1111,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1158,7 +1163,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1212,7 +1217,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1276,7 +1281,7 @@ async def generalize( # 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1322,7 +1327,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1404,7 +1409,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1491,7 +1496,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1574,7 +1579,7 @@ async def _power_off_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1635,7 +1640,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1688,7 +1693,7 @@ async def _restart_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1741,7 +1746,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1793,7 +1798,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1846,7 +1851,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1898,7 +1903,7 @@ async def _redeploy_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1951,7 +1956,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2007,7 +2012,7 @@ async def _reimage_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2157,7 +2162,7 @@ async def begin_reimage( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -2212,7 +2217,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2267,7 +2272,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2319,7 +2324,7 @@ async def _run_command_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2472,7 +2477,7 @@ async def begin_run_command( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py index fbc6a5e253ba..c28c4949ed89 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -101,8 +106,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py index e15c2c436dc4..2caf8d24e164 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py index 44f539af3e63..d24910d4a52d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +332,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -467,7 +472,7 @@ def 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -539,7 +544,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ def get(self, resource_group_name: str, host_group_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -642,7 +647,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -723,7 +728,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py index 620c5d1369a5..a8979fdb550b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,13 +145,13 @@ def build_get_request( host_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_group_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -795,7 +800,7 @@ def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -825,7 +830,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -880,7 +885,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py index ab9a1e6db9eb..929e17a6c354 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py index e84463d31aa1..b0165ea96139 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_get_request(resource_group_name: str, gallery_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +222,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -377,7 +382,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -444,7 +449,7 @@ def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -492,7 +497,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -545,7 +550,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -597,7 +602,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -677,7 +682,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py index b8b19f8edd19..691a8e3e6d1e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -94,7 +99,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +176,7 @@ def build_list_by_gallery_application_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -236,7 +241,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -437,7 +442,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -524,7 +529,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -580,7 +585,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -649,7 +654,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -713,7 +718,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py index b8ba99d2c347..6620f4d240b7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_list_by_gallery_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -389,7 +394,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -463,7 +468,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -512,7 +517,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -572,7 +577,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -630,7 +635,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py index 8463d2141e90..f4e75520b55d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,7 +170,7 @@ def build_list_by_gallery_image_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,7 +235,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -429,7 +434,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -572,7 +577,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -641,7 +646,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -704,7 +709,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py index 079c73a12d57..41e868736cee 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_list_by_gallery_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -386,7 +391,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -459,7 +464,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -508,7 +513,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -567,7 +572,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -625,7 +630,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py index 8613b45d6ffe..38285b0a1a2f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py index 2342f021cc95..758ae590bd6e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py index 363de76781ee..35371e993f12 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py index 9e858cfd94a4..a261b37b4065 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -141,7 +146,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -333,7 +338,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -475,7 +480,7 @@ def 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -547,7 +552,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -603,7 +608,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -651,7 +656,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -736,7 +741,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py index 13c0e7a0050a..c217f374a64e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py index 245c934a0dc1..c64ff1e80461 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py index f42a70491158..353c1e316e5b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py index dcba6858471d..6cbd034f42c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py index 7b837d005875..bff84a86d558 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py index 3f2208178cb2..ec996520c0d4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py index 4b1f054c85b0..0bb938a5e533 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -111,7 +116,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +150,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -384,7 +389,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -442,7 +447,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -501,7 +506,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -575,7 +580,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -631,7 +636,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 935afb823e94..65c4bf707477 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py index 3a8edeecaa0d..983d8a2392b8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,13 +194,13 @@ def build_get_request( instance_id: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -229,7 +234,7 @@ def build_get_instance_view_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +273,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +317,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -340,7 +345,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -366,7 +371,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -392,7 +397,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -418,7 +423,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -445,7 +450,7 @@ def build_run_command_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -512,7 +517,7 @@ def _reimage_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -674,7 +679,7 @@ def begin_reimage( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -730,7 +735,7 @@ def _reimage_all_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -789,7 +794,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -842,7 +847,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -902,7 +907,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -960,7 +965,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1134,7 +1139,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1192,7 +1197,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1250,7 +1255,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1295,7 +1300,7 @@ def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -1325,7 +1330,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1389,7 +1394,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1460,7 +1465,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1551,7 +1556,7 @@ def _power_off_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1621,7 +1626,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1675,7 +1680,7 @@ def _restart_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1733,7 +1738,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1786,7 +1791,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1844,7 +1849,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1897,7 +1902,7 @@ def _redeploy_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1956,7 +1961,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2009,7 +2014,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2067,7 +2072,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2125,7 +2130,7 @@ def _run_command_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2289,7 +2294,7 @@ def begin_run_command( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py index 9074352cf0e7..52ce8dffddc8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -382,7 +387,7 @@ def build_power_off_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -415,7 +420,7 @@ def build_restart_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -446,7 +451,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -477,7 +482,7 @@ def build_redeploy_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -508,7 +513,7 @@ def build_perform_maintenance_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -539,7 +544,7 @@ def build_update_instances_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +575,7 @@ def build_reimage_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -601,7 +606,7 @@ def build_reimage_all_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -637,7 +642,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -669,7 +674,7 @@ def build_convert_to_single_placement_group_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -731,7 +736,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -889,7 +894,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -950,7 +955,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1104,7 +1109,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1161,7 +1166,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1214,7 +1219,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1276,7 +1281,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1328,7 +1333,7 @@ def _deallocate_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1486,7 +1491,7 @@ def begin_deallocate( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -1545,7 +1550,7 @@ def _delete_instances_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1694,7 +1699,7 @@ def begin_delete_instances( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -1761,7 +1766,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1811,7 +1816,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1895,7 +1900,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1983,7 +1988,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2072,7 +2077,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2160,7 +2165,7 @@ def _power_off_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2334,7 +2339,7 @@ def begin_power_off( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -2394,7 +2399,7 @@ def _restart_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2546,7 +2551,7 @@ def begin_restart( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -2605,7 +2610,7 @@ def _start_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2757,7 +2762,7 @@ def begin_start( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -2816,7 +2821,7 @@ def _redeploy_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2971,7 +2976,7 @@ def begin_redeploy( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -3030,7 +3035,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3191,7 +3196,7 @@ def begin_perform_maintenance( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -3250,7 +3255,7 @@ def _update_instances_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3399,7 +3404,7 @@ def begin_update_instances( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -3458,7 +3463,7 @@ def _reimage_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3614,7 +3619,7 @@ def begin_reimage( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -3673,7 +3678,7 @@ def _reimage_all_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3828,7 +3833,7 @@ def begin_reimage_all( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -3899,7 +3904,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4029,7 +4034,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py index 8f5e48136f37..07aea22061a1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py index 6541ace7c001..4aeb5f266654 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -384,7 +394,7 @@ def build_list_available_sizes_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -414,7 +424,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -439,7 +449,7 @@ def build_power_off_request( def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -462,7 +472,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -485,7 +495,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -509,7 +519,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -539,7 +549,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -565,7 +575,7 @@ def build_run_command_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -627,7 +637,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -713,7 +723,7 @@ def _capture_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -873,7 +883,7 @@ def begin_capture( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -932,7 +942,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1084,7 +1094,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1141,7 +1151,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1293,7 +1303,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1350,7 +1360,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1403,7 +1413,7 @@ def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1443,7 +1453,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1470,7 +1480,7 @@ 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1531,7 +1541,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1579,7 +1589,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1633,7 +1643,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1685,7 +1695,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1739,7 +1749,7 @@ def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1813,7 @@ def generalize( # 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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1848,7 +1858,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1929,7 +1939,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2015,7 +2025,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2098,7 +2108,7 @@ def _power_off_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2159,7 +2169,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2212,7 +2222,7 @@ def _restart_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2265,7 +2275,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2317,7 +2327,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2370,7 +2380,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2422,7 +2432,7 @@ def _redeploy_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2475,7 +2485,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2531,7 +2541,7 @@ def _reimage_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2681,7 +2691,7 @@ def begin_reimage( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] 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] @@ -2736,7 +2746,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2789,7 +2799,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2841,7 +2851,7 @@ def _run_command_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2991,7 +3001,7 @@ def begin_run_command( _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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py index d39313639f31..005867dddb2d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-04-01") # type: str + api_version = kwargs.pop("api_version", "2019-04-01") # type: Literal["2019-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json index 1220004ee026..7796c5b190dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json @@ -99,4 +99,4 @@ "operation_groups": { "resource_skus": "ResourceSkusOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py index 5356da17f36b..7e8602c29737 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-04-01") # type: str + api_version = kwargs.pop("api_version", "2019-04-01") # type: Literal["2019-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py index 1128e7b0656a..21abddf08259 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._resource_skus_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, filter: 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", _params.pop("api-version", "2019-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: Literal["2019-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py index 29ea2ae61478..a94333a8ba8d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(subscription_id: str, *, filter: 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", _params.pop("api-version", "2019-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: Literal["2019-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, filter: 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", _params.pop("api-version", "2019-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: Literal["2019-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py index 83d3a0b34feb..9f3a26184a84 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-07-01") # type: str + api_version = kwargs.pop("api_version", "2019-07-01") # type: Literal["2019-07-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json index 94b88b56146f..a4531282e517 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json @@ -125,4 +125,4 @@ "gallery_application_versions": "GalleryApplicationVersionsOperations", "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py index 93f0691bb86c..da01e04407cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-07-01") # type: str + api_version = kwargs.pop("api_version", "2019-07-01") # type: Literal["2019-07-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py index debe6d22f53c..70a43caa8947 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py index 05b8a59dd945..75b6a77f7cb1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ async def get(self, resource_group_name: str, host_group_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -474,7 +479,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -556,7 +561,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py index 304401fdd17a..087721369146 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -638,7 +643,7 @@ async def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -668,7 +673,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -724,7 +729,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py index 2ad80ea2a9c0..e5c67ac2920c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -247,7 +252,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -308,7 +313,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -475,7 +480,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -546,7 +551,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -594,7 +599,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -651,7 +656,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -706,7 +711,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -787,7 +792,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py index d5bf032df6e3..e67fc9a33642 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py index 248a9d3b7846..77bd05354642 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -517,7 +522,7 @@ async def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -565,7 +570,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -670,7 +675,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -750,7 +755,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py index de66863d6baf..e472ef910e30 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py index 966a89eaebec..162f99917b56 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py index 07b9c5412b20..49ffeef7bcce 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py index a0c74f537ac8..1d216d92e97f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py index 492d44973d88..b375661e1837 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py index 97cf50200f9e..36bf638fec21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py index f7078e1b3011..559e0a505268 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py index bfcc7eaf2db3..2d878e57654e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py index 98074bacd9c3..703a61574708 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py index 07cf82201f3a..3d051ae09a45 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py index 86900146baca..d5cc7b1e8a00 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py index a38fa342bda2..bab4888b8175 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py index 7a61e6dd2383..5561a3192daf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py index e1c3d4e94113..0cc33e938636 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index f2c87904a04f..bbd99c22715f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 827771e3575c..1b988c74817f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 08ef3fc721d5..90afa69d44c4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -260,7 +265,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -325,7 +330,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -504,7 +509,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -774,7 +779,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 71308fd82782..fe373efe0a16 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def _reimage_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -251,7 +256,7 @@ async def begin_reimage( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -307,7 +312,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -366,7 +371,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -479,7 +484,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -537,7 +542,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -711,7 +716,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -769,7 +774,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -827,7 +832,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -872,7 +877,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -902,7 +907,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -966,7 +971,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1037,7 +1042,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1128,7 +1133,7 @@ async def _power_off_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1198,7 +1203,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1252,7 +1257,7 @@ async def _restart_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1310,7 +1315,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1363,7 +1368,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1421,7 +1426,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1479,7 @@ async def _redeploy_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1533,7 +1538,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1586,7 +1591,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1645,7 +1650,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1703,7 +1708,7 @@ async def _run_command_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -1870,7 +1875,7 @@ async def begin_run_command( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py index 428717cb8e6e..19d53a2924a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -54,6 +55,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -253,7 +258,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -468,7 +473,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -525,7 +530,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -580,7 +585,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -644,7 +649,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -696,7 +701,7 @@ async def _deallocate_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -854,7 +859,7 @@ async def begin_deallocate( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -913,7 +918,7 @@ async def _delete_instances_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1062,7 +1067,7 @@ async def begin_delete_instances( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -1129,7 +1134,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1179,7 +1184,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1263,7 +1268,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1351,7 +1356,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1440,7 +1445,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1528,7 +1533,7 @@ async def _power_off_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1702,7 +1707,7 @@ async def begin_power_off( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -1762,7 +1767,7 @@ async def _restart_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1914,7 +1919,7 @@ async def begin_restart( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -1973,7 +1978,7 @@ async def _start_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2125,7 +2130,7 @@ async def begin_start( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -2184,7 +2189,7 @@ async def _redeploy_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2339,7 +2344,7 @@ async def begin_redeploy( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -2398,7 +2403,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2559,7 +2564,7 @@ async def begin_perform_maintenance( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -2618,7 +2623,7 @@ async def _update_instances_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2767,7 +2772,7 @@ async def begin_update_instances( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -2826,7 +2831,7 @@ async def _reimage_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2982,7 +2987,7 @@ async def begin_reimage( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -3041,7 +3046,7 @@ async def _reimage_all_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3196,7 +3201,7 @@ async def begin_reimage_all( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -3267,7 +3272,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3397,7 +3402,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py index 4b33c0c7976f..b507f400da46 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py index 835eff2b30e7..cc21b9d11780 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -54,6 +55,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,7 +98,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -179,7 +184,7 @@ async def _capture_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -339,7 +344,7 @@ async def begin_capture( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -398,7 +403,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -556,7 +561,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -613,7 +618,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -878,7 +883,7 @@ async def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -918,7 +923,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -945,7 +950,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1006,7 +1011,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1054,7 +1059,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1114,7 +1119,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1166,7 +1171,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1220,7 +1225,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1289,7 +1294,7 @@ async def generalize( # 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1335,7 +1340,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1420,7 +1425,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1508,7 +1513,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1591,7 +1596,7 @@ async def _power_off_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1652,7 +1657,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1705,7 +1710,7 @@ async def _reapply_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1758,7 +1763,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1810,7 +1815,7 @@ async def _restart_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1863,7 +1868,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1915,7 +1920,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1968,7 +1973,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2020,7 +2025,7 @@ async def _redeploy_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2073,7 +2078,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2129,7 +2134,7 @@ async def _reimage_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2279,7 +2284,7 @@ async def begin_reimage( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -2334,7 +2339,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2390,7 +2395,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2442,7 +2447,7 @@ async def _run_command_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2595,7 +2600,7 @@ async def begin_run_command( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py index 2ba8c9de33af..36b375ba1f21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -101,8 +106,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py index 057babf218d1..3857ab385532 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py index 97287814af9e..e96e6f17d539 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +332,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -467,7 +472,7 @@ def 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -539,7 +544,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ def get(self, resource_group_name: str, host_group_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -642,7 +647,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -723,7 +728,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py index 70924734df4f..78169a0e4d20 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,13 +145,13 @@ def build_get_request( host_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_group_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -795,7 +800,7 @@ def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -825,7 +830,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -880,7 +885,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py index 4bb58f5eeb20..006af850984e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +262,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -421,7 +426,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -646,7 +651,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -715,7 +720,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -763,7 +768,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -818,7 +823,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -870,7 +875,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -950,7 +955,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py index ebe03be6cf1b..0974bba3b135 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py index 67600588178c..2f3f511b27ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, gallery_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -411,7 +416,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -468,7 +473,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -619,7 +624,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -734,7 +739,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -839,7 +844,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -919,7 +924,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py index d5d68ed846fb..b490f843e676 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py index 408575e3c7cc..4aa954f76720 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py index 2f932abc150e..ac335377f0fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py index 518315f7b0c3..ab72d74aae48 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py index b6e6e0d0ef0c..910be164dfb7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py index 15931016cfb9..a15213b3ce12 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py index 3a858d68645a..1119d3a1ba47 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py index 52f8408e6e60..cc7f4cf2bcdd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ def 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py index bace6340be0b..7d9fa16f54c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py index 16cccadc6741..d36f52bf74ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py index 1d2c2bb279a7..de4983a6f4f4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py index c2162ec214ea..448df2fd1615 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py index 1b0d3a79bd90..da144350e510 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py index b8160dd8c22a..21c3ba42dfba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py index 28fc2c1b1580..99ec350bbc9d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 615f73c1748a..77d240f4afc3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index e19396d16ea8..b26f29c828ee 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -459,7 +464,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -524,7 +529,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -703,7 +708,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -762,7 +767,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -823,7 +828,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -973,7 +978,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py index f65a48576ab6..cd8a4b314280 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,13 +194,13 @@ def build_get_request( instance_id: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -229,7 +234,7 @@ def build_get_instance_view_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +273,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +317,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -340,7 +345,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -366,7 +371,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -392,7 +397,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -418,7 +423,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -445,7 +450,7 @@ def build_run_command_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -512,7 +517,7 @@ def _reimage_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -674,7 +679,7 @@ def begin_reimage( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -730,7 +735,7 @@ def _reimage_all_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -789,7 +794,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -842,7 +847,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -902,7 +907,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -960,7 +965,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1134,7 +1139,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1192,7 +1197,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1250,7 +1255,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1295,7 +1300,7 @@ def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -1325,7 +1330,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1389,7 +1394,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1460,7 +1465,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1551,7 +1556,7 @@ def _power_off_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1621,7 +1626,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1675,7 +1680,7 @@ def _restart_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1733,7 +1738,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1786,7 +1791,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1844,7 +1849,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1897,7 +1902,7 @@ def _redeploy_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1956,7 +1961,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2009,7 +2014,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2068,7 +2073,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2126,7 +2131,7 @@ def _run_command_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2290,7 +2295,7 @@ def begin_run_command( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py index eadf209488c9..e1e296c6c92f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -382,7 +387,7 @@ def build_power_off_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -415,7 +420,7 @@ def build_restart_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -446,7 +451,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -477,7 +482,7 @@ def build_redeploy_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -508,7 +513,7 @@ def build_perform_maintenance_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -539,7 +544,7 @@ def build_update_instances_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +575,7 @@ def build_reimage_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -601,7 +606,7 @@ def build_reimage_all_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -637,7 +642,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -669,7 +674,7 @@ def build_convert_to_single_placement_group_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -731,7 +736,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -889,7 +894,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -950,7 +955,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1104,7 +1109,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1161,7 +1166,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1214,7 +1219,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1276,7 +1281,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1328,7 +1333,7 @@ def _deallocate_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1486,7 +1491,7 @@ def begin_deallocate( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -1545,7 +1550,7 @@ def _delete_instances_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1694,7 +1699,7 @@ def begin_delete_instances( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -1761,7 +1766,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1811,7 +1816,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1895,7 +1900,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1983,7 +1988,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2072,7 +2077,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2160,7 +2165,7 @@ def _power_off_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2334,7 +2339,7 @@ def begin_power_off( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -2394,7 +2399,7 @@ def _restart_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2546,7 +2551,7 @@ def begin_restart( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -2605,7 +2610,7 @@ def _start_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2757,7 +2762,7 @@ def begin_start( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -2816,7 +2821,7 @@ def _redeploy_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2971,7 +2976,7 @@ def begin_redeploy( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -3030,7 +3035,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3191,7 +3196,7 @@ def begin_perform_maintenance( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -3250,7 +3255,7 @@ def _update_instances_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3399,7 +3404,7 @@ def begin_update_instances( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -3458,7 +3463,7 @@ def _reimage_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3614,7 +3619,7 @@ def begin_reimage( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -3673,7 +3678,7 @@ def _reimage_all_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3828,7 +3833,7 @@ def begin_reimage_all( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -3899,7 +3904,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4029,7 +4034,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py index cb2a0cc41f24..47dceb400334 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py index 2b8c2da3dd62..7be6c6459342 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[str] = _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -386,7 +396,7 @@ def build_list_available_sizes_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -416,7 +426,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -442,7 +452,7 @@ def build_reapply_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -470,7 +480,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -493,7 +503,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -516,7 +526,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -540,7 +550,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +580,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -596,7 +606,7 @@ def build_run_command_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -658,7 +668,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -744,7 +754,7 @@ def _capture_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -904,7 +914,7 @@ def begin_capture( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -963,7 +973,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1118,7 +1128,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1175,7 +1185,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1327,7 +1337,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1384,7 +1394,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1437,7 +1447,7 @@ def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1477,7 +1487,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1504,7 +1514,7 @@ 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1565,7 +1575,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1613,7 +1623,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1671,7 +1681,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1723,7 +1733,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1777,7 +1787,7 @@ def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1846,7 +1856,7 @@ def generalize( # 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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1891,7 +1901,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1975,7 +1985,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2062,7 +2072,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2145,7 +2155,7 @@ def _power_off_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2206,7 +2216,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2259,7 +2269,7 @@ def _reapply_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2312,7 +2322,7 @@ def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2364,7 +2374,7 @@ def _restart_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2417,7 +2427,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2469,7 +2479,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2522,7 +2532,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2574,7 +2584,7 @@ def _redeploy_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2627,7 +2637,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2683,7 +2693,7 @@ def _reimage_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2833,7 +2843,7 @@ def begin_reimage( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] 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] @@ -2888,7 +2898,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2942,7 +2952,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2994,7 +3004,7 @@ def _run_command_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3144,7 +3154,7 @@ def begin_run_command( _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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py index 5e5f62ae39b2..dd548de401d7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-11-01") # type: str + api_version = kwargs.pop("api_version", "2019-11-01") # type: Literal["2019-11-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json index f82e8c845be1..153505da61da 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json @@ -101,4 +101,4 @@ "snapshots": "SnapshotsOperations", "disk_encryption_sets": "DiskEncryptionSetsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py index 2d5691f5f007..a80189873f21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-11-01") # type: str + api_version = kwargs.pop("api_version", "2019-11-01") # type: Literal["2019-11-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py index 981b87074dc4..13554fd5bdf0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -247,7 +252,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -308,7 +313,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -475,7 +480,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -546,7 +551,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -594,7 +599,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -651,7 +656,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -706,7 +711,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -787,7 +792,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py index 101ac4362e1f..4d2df9e8c677 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py index 557ee4c638b9..2b595bb69c63 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py index 787709ac4661..e41b2a699986 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +262,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -421,7 +426,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -646,7 +651,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -715,7 +720,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -763,7 +768,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -818,7 +823,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -870,7 +875,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -950,7 +955,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py index c2eacfdb0201..848d650d6a40 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py index 4208a94c3927..fcda27f5598f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py index 52e3e7fa3ce5..2c6e9fa74b5a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-12-01") # type: str + api_version = kwargs.pop("api_version", "2019-12-01") # type: Literal["2019-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json index 0511985e4235..c50105de83ee 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json @@ -123,4 +123,4 @@ "gallery_applications": "GalleryApplicationsOperations", "gallery_application_versions": "GalleryApplicationVersionsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py index ae53f2144c3d..b0eb825a9953 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-12-01") # type: str + api_version = kwargs.pop("api_version", "2019-12-01") # type: Literal["2019-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py index 7ecf15c1b560..a00fe0a73120 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py index 596c1e2c8606..a01728c51cd8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ async def get(self, resource_group_name: str, host_group_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -474,7 +479,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -556,7 +561,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py index 871a1df7e0c7..3d39dcf7afa8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -638,7 +643,7 @@ async def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -668,7 +673,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -724,7 +729,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py index 20f0cc27ab66..21ccb343242b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -517,7 +522,7 @@ async def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -565,7 +570,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -670,7 +675,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -750,7 +755,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py index db5842633872..f080c6149815 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py index 963e5a68a989..aff42878d68d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py index a40fb1c5edf6..88320adba95a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py index 2eb11bcfabfc..8f1535b64e7a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py index 598800cbf3b1..87d808ce1d95 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py index 3a956dfe9bf5..d8e6ef624d38 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py index fb56dbb8d35e..0ec892fa4f04 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py index c6abf7dc0701..e69628b0bd67 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py index 7e900d02278c..c2df8a8780d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py index 9f8f663afb3a..5ea95bb3fe80 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py index 7c713158e46a..4158b220438a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py index d48af93dddae..618fa23affe0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py index e48ec1062825..3cc99364617b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py index 18a664b11218..91921872ad7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index a9347f1f285b..a3de252f9645 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 7f9000e3944b..51b4b3cad01a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 53bfb0dcd871..4682290c0881 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -260,7 +265,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -325,7 +330,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -504,7 +509,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -774,7 +779,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 2edbb16308f9..9f5a263bef7e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -48,6 +49,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ async def _reimage_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -252,7 +257,7 @@ async def begin_reimage( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -308,7 +313,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -367,7 +372,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -420,7 +425,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -480,7 +485,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -538,7 +543,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -712,7 +717,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -770,7 +775,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -828,7 +833,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -873,7 +878,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -903,7 +908,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -967,7 +972,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1038,7 +1043,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1129,7 +1134,7 @@ async def _power_off_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1199,7 +1204,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1253,7 +1258,7 @@ async def _restart_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1311,7 +1316,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1364,7 +1369,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1422,7 +1427,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1475,7 +1480,7 @@ async def _redeploy_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1534,7 +1539,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1587,7 +1592,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1646,7 +1651,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1714,7 +1719,7 @@ async def simulate_eviction( # 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1764,7 +1769,7 @@ async def _run_command_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -1931,7 +1936,7 @@ async def begin_run_command( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py index 883db3fcede2..4d0162fdd1f8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -55,6 +56,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -254,7 +259,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -469,7 +474,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -526,7 +531,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -581,7 +586,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -645,7 +650,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -697,7 +702,7 @@ async def _deallocate_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -855,7 +860,7 @@ async def begin_deallocate( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -914,7 +919,7 @@ async def _delete_instances_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1063,7 +1068,7 @@ async def begin_delete_instances( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -1130,7 +1135,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1180,7 +1185,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1264,7 +1269,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1352,7 +1357,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1441,7 +1446,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1529,7 +1534,7 @@ async def _power_off_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1703,7 +1708,7 @@ async def begin_power_off( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -1763,7 +1768,7 @@ async def _restart_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1915,7 +1920,7 @@ async def begin_restart( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -1974,7 +1979,7 @@ async def _start_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2126,7 +2131,7 @@ async def begin_start( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -2185,7 +2190,7 @@ async def _redeploy_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2340,7 +2345,7 @@ async def begin_redeploy( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -2399,7 +2404,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2560,7 +2565,7 @@ async def begin_perform_maintenance( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -2619,7 +2624,7 @@ async def _update_instances_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2768,7 +2773,7 @@ async def begin_update_instances( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -2827,7 +2832,7 @@ async def _reimage_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2983,7 +2988,7 @@ async def begin_reimage( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -3042,7 +3047,7 @@ async def _reimage_all_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3197,7 +3202,7 @@ async def begin_reimage_all( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -3268,7 +3273,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3398,7 +3403,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3458,7 +3463,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3606,7 +3611,7 @@ async def begin_set_orchestration_service_state( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py index a4ce3420f3e8..2261c1f3ba07 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py index bf3f34042c06..c219da15128e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -55,6 +56,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -180,7 +185,7 @@ async def _capture_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -340,7 +345,7 @@ async def begin_capture( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -399,7 +404,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -557,7 +562,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -614,7 +619,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -769,7 +774,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -826,7 +831,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -879,7 +884,7 @@ async def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -919,7 +924,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -946,7 +951,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1007,7 +1012,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1055,7 +1060,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1115,7 +1120,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1167,7 +1172,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1221,7 +1226,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1290,7 +1295,7 @@ async def generalize( # 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1336,7 +1341,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1421,7 +1426,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1509,7 +1514,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1592,7 +1597,7 @@ async def _power_off_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1653,7 +1658,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1706,7 +1711,7 @@ async def _reapply_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1759,7 +1764,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1811,7 +1816,7 @@ async def _restart_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1864,7 +1869,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1916,7 +1921,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1969,7 +1974,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2021,7 +2026,7 @@ async def _redeploy_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2074,7 +2079,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2130,7 +2135,7 @@ async def _reimage_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2280,7 +2285,7 @@ async def begin_reimage( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -2335,7 +2340,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2391,7 +2396,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2456,7 +2461,7 @@ async def simulate_eviction( # 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2500,7 +2505,7 @@ async def _run_command_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2653,7 +2658,7 @@ async def begin_run_command( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py index ad85fa615e8b..bd03113b87c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -78,8 +83,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py index 912fde852f0b..c6c3e6eb8b6b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py index 0e7c20557385..0a08debc9a2b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +332,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -467,7 +472,7 @@ def 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -539,7 +544,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ def get(self, resource_group_name: str, host_group_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -642,7 +647,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -723,7 +728,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py index f4847ebd541a..af98da4f37a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,13 +145,13 @@ def build_get_request( host_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_group_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -795,7 +800,7 @@ def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -825,7 +830,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -880,7 +885,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py index 55ac0d3fb6e7..019f900b0acd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, gallery_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -411,7 +416,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -468,7 +473,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -619,7 +624,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -734,7 +739,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -839,7 +844,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -919,7 +924,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py index 225be80b3133..99a2fb9fe043 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py index a0855d8c40a3..85fc65cd171e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py index 8c7911ba76f5..b411f65fc807 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py index 7efda3445eaf..44060bdb405a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py index 318a143b47da..7679cc194f37 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py index c6ccc29951b1..ad7a7f510d0e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py index 20d74b3b589e..2f348fd7b938 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py index 48f0ad2bd621..295662659512 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ def 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py index 9baeaba28599..030c6a184b16 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ def create( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ def 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py index 4ff36f8f42df..3c8f096a9e38 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py index 27c109150bef..846022c96f06 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py index daf9be53d302..086a9fdd2eeb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py index 7120cce58465..490a575542c3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py index 692346ce1575..70e13ee98d9a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py index 99ebebdab871..6713d0932121 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 8111b2fdf53b..92871b95b5d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 3e22207533a1..0f2aaf1c3b94 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -459,7 +464,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -524,7 +529,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -703,7 +708,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -762,7 +767,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -823,7 +828,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -973,7 +978,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py index 950e63101b54..1bf458f8fab3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,13 +194,13 @@ def build_get_request( instance_id: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -229,7 +234,7 @@ def build_get_instance_view_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +273,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +317,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -340,7 +345,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -366,7 +371,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -392,7 +397,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -418,7 +423,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -444,7 +449,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -471,7 +476,7 @@ def build_run_command_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -538,7 +543,7 @@ def _reimage_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -700,7 +705,7 @@ def begin_reimage( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -756,7 +761,7 @@ def _reimage_all_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -815,7 +820,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -868,7 +873,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -928,7 +933,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -986,7 +991,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1160,7 +1165,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1218,7 +1223,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1276,7 +1281,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1321,7 +1326,7 @@ def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -1351,7 +1356,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1415,7 +1420,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1486,7 +1491,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1577,7 +1582,7 @@ def _power_off_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1647,7 +1652,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1701,7 +1706,7 @@ def _restart_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1759,7 +1764,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1812,7 +1817,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1870,7 +1875,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1923,7 +1928,7 @@ def _redeploy_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1982,7 +1987,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2035,7 +2040,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2094,7 +2099,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2162,7 +2167,7 @@ def simulate_eviction( # 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2212,7 +2217,7 @@ def _run_command_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2376,7 +2381,7 @@ def begin_run_command( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py index cb25f86f7823..db05bdb98e9c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -382,7 +387,7 @@ def build_power_off_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -415,7 +420,7 @@ def build_restart_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -446,7 +451,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -477,7 +482,7 @@ def build_redeploy_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -508,7 +513,7 @@ def build_perform_maintenance_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -539,7 +544,7 @@ def build_update_instances_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +575,7 @@ def build_reimage_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -601,7 +606,7 @@ def build_reimage_all_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -637,7 +642,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -669,7 +674,7 @@ def build_convert_to_single_placement_group_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -700,7 +705,7 @@ def build_set_orchestration_service_state_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -762,7 +767,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -920,7 +925,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -981,7 +986,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1135,7 +1140,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1192,7 +1197,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1245,7 +1250,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1307,7 +1312,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1359,7 +1364,7 @@ def _deallocate_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1517,7 +1522,7 @@ def begin_deallocate( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -1576,7 +1581,7 @@ def _delete_instances_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1725,7 +1730,7 @@ def begin_delete_instances( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -1792,7 +1797,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1842,7 +1847,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1926,7 +1931,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2014,7 +2019,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2103,7 +2108,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2191,7 +2196,7 @@ def _power_off_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2365,7 +2370,7 @@ def begin_power_off( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -2425,7 +2430,7 @@ def _restart_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2577,7 +2582,7 @@ def begin_restart( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -2636,7 +2641,7 @@ def _start_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2788,7 +2793,7 @@ def begin_start( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -2847,7 +2852,7 @@ def _redeploy_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3002,7 +3007,7 @@ def begin_redeploy( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -3061,7 +3066,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3222,7 +3227,7 @@ def begin_perform_maintenance( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -3281,7 +3286,7 @@ def _update_instances_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3430,7 +3435,7 @@ def begin_update_instances( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -3489,7 +3494,7 @@ def _reimage_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3645,7 +3650,7 @@ def begin_reimage( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -3704,7 +3709,7 @@ def _reimage_all_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3859,7 +3864,7 @@ def begin_reimage_all( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -3930,7 +3935,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4060,7 +4065,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4120,7 +4125,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4268,7 +4273,7 @@ def begin_set_orchestration_service_state( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py index beab47040534..80a887a78d83 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py index 1cd8945ebc71..c2f6cf9da535 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[str] = _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -386,7 +396,7 @@ def build_list_available_sizes_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -416,7 +426,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -442,7 +452,7 @@ def build_reapply_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -470,7 +480,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -493,7 +503,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -516,7 +526,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -540,7 +550,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +580,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -595,7 +605,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -621,7 +631,7 @@ def build_run_command_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -683,7 +693,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -769,7 +779,7 @@ def _capture_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -929,7 +939,7 @@ def begin_capture( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -988,7 +998,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1143,7 +1153,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1200,7 +1210,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1352,7 +1362,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1409,7 +1419,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1462,7 +1472,7 @@ def begin_delete(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1502,7 +1512,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1529,7 +1539,7 @@ 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1590,7 +1600,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1638,7 +1648,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1696,7 +1706,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1748,7 +1758,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1802,7 +1812,7 @@ def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1871,7 +1881,7 @@ def generalize( # 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1916,7 +1926,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2000,7 +2010,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2087,7 +2097,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2170,7 +2180,7 @@ def _power_off_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2231,7 +2241,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2284,7 +2294,7 @@ def _reapply_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2337,7 +2347,7 @@ def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2389,7 +2399,7 @@ def _restart_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2442,7 +2452,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2494,7 +2504,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2547,7 +2557,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2599,7 +2609,7 @@ def _redeploy_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2652,7 +2662,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2708,7 +2718,7 @@ def _reimage_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2858,7 +2868,7 @@ def begin_reimage( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] 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] @@ -2913,7 +2923,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2967,7 +2977,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3032,7 +3042,7 @@ def simulate_eviction( # 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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3076,7 +3086,7 @@ def _run_command_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3226,7 +3236,7 @@ def begin_run_command( _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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py index 5d707da9e71d..59e9a04badf4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-05-01") # type: str + api_version = kwargs.pop("api_version", "2020-05-01") # type: Literal["2020-05-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json index fae998f23ae1..8e3dde8fa19f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json @@ -102,4 +102,4 @@ "disk_encryption_sets": "DiskEncryptionSetsOperations", "disk_accesses": "DiskAccessesOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py index f0d142f8e5e6..a47a8d62d634 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-05-01") # type: str + api_version = kwargs.pop("api_version", "2020-05-01") # type: Literal["2020-05-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py index 7c5e2a3214ba..732aa7442c37 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -237,7 +242,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -298,7 +303,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -462,7 +467,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -531,7 +536,7 @@ async def get(self, resource_group_name: str, disk_access_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -579,7 +584,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -636,7 +641,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -689,7 +694,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -770,7 +775,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -865,7 +870,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py index 90061c854666..eca4e46184bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -247,7 +252,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -308,7 +313,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -475,7 +480,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -546,7 +551,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -594,7 +599,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -651,7 +656,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -706,7 +711,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -787,7 +792,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py index 828f1bb385a3..c7abe2541cc8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py index 10aba2353c73..3a064b9934e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py index 90961a09f4f7..542db974b47c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +289,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -441,7 +446,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -502,7 +507,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -663,7 +668,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -732,7 +737,7 @@ def get(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -780,7 +785,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -835,7 +840,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -887,7 +892,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -967,7 +972,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1062,7 +1067,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py index b9e39c64214f..f2cd60868496 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +262,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -421,7 +426,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -646,7 +651,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -715,7 +720,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -763,7 +768,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -818,7 +823,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -870,7 +875,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -950,7 +955,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py index 46c52954a097..f4d17b47fd6f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py index 1aaea228b501..4a374ee095a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py index 7fd4c69c4191..f8a1a05de446 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-06-01") # type: str + api_version = kwargs.pop("api_version", "2020-06-01") # type: Literal["2020-06-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json index 605e288ca50d..dac57db865c8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json @@ -119,4 +119,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py index 111130a388f4..1a01ece54139 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-06-01") # type: str + api_version = kwargs.pop("api_version", "2020-06-01") # type: Literal["2020-06-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py index 951b841db989..1314dd0fef2a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py index 4a777a048ec9..73b2274f3c22 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -400,7 +405,11 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, host_group_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + host_group_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> _models.DedicatedHostGroup: """Retrieves information about a dedicated host group. @@ -428,7 +437,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -481,7 +490,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -563,7 +572,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py index 389f1a6f1dd4..364696277b91 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -638,7 +643,7 @@ async def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -668,7 +673,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -724,7 +729,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py index c94208f8ed0e..5be1761e2f91 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py index 69e847941d5e..46388ca88c64 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py index ec003454dc83..5b0f03ab8cd4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py index 7f282186952b..6c571d583f54 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py index 605681bfe697..28d224df8d19 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py index f6aea57b4072..461d96286ea1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py index 04bef1c95b74..fc0ebf0dcea0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py index 628634e75bb6..d01966b3a47d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py index cabf0c4a4530..c71ce634bfb4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py index 6a83659c4f76..0db69908f0d9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 9c484aa54c16..ac0323059140 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 870f9b0e6143..ad2cd7630708 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 9a564c859a1c..00be821c04f1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index cbd11ff7e46b..683fb068a9cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 5eede6cbd4e5..9d30a3b994d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -771,7 +776,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -829,7 +834,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -874,7 +879,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -904,7 +909,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -968,7 +973,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1039,7 +1044,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1130,7 +1135,7 @@ async def _power_off_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1200,7 +1205,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1254,7 +1259,7 @@ async def _restart_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1312,7 +1317,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1365,7 +1370,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1423,7 +1428,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1476,7 +1481,7 @@ async def _redeploy_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1535,7 +1540,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1612,7 +1617,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1662,7 +1667,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1720,7 +1725,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1787,7 +1792,7 @@ async def simulate_eviction( # 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1837,7 +1842,7 @@ async def _run_command_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2004,7 +2009,7 @@ async def begin_run_command( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py index b9f22aceab19..033a8ef15c07 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -55,6 +56,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -254,7 +259,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -469,7 +474,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -526,7 +531,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -581,7 +586,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -645,7 +650,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -697,7 +702,7 @@ async def _deallocate_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -855,7 +860,7 @@ async def begin_deallocate( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -914,7 +919,7 @@ async def _delete_instances_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1063,7 +1068,7 @@ async def begin_delete_instances( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -1130,7 +1135,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1180,7 +1185,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1264,7 +1269,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1352,7 +1357,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1441,7 +1446,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1529,7 +1534,7 @@ async def _power_off_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1703,7 +1708,7 @@ async def begin_power_off( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -1763,7 +1768,7 @@ async def _restart_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1915,7 +1920,7 @@ async def begin_restart( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -1974,7 +1979,7 @@ async def _start_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2126,7 +2131,7 @@ async def begin_start( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -2185,7 +2190,7 @@ async def _redeploy_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2340,7 +2345,7 @@ async def begin_redeploy( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -2399,7 +2404,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2560,7 +2565,7 @@ async def begin_perform_maintenance( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -2619,7 +2624,7 @@ async def _update_instances_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2768,7 +2773,7 @@ async def begin_update_instances( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -2827,7 +2832,7 @@ async def _reimage_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2983,7 +2988,7 @@ async def begin_reimage( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -3042,7 +3047,7 @@ async def _reimage_all_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3197,7 +3202,7 @@ async def begin_reimage_all( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -3268,7 +3273,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3398,7 +3403,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3458,7 +3463,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3606,7 +3611,7 @@ async def begin_set_orchestration_service_state( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py index 92f2f112c840..9b858dc5d615 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py index 88c40e804fc0..7598f5f94c53 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -57,6 +58,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -182,7 +187,7 @@ async def _capture_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -342,7 +347,7 @@ async def begin_capture( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -559,7 +564,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -616,7 +621,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -771,7 +776,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -828,7 +833,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -887,7 +892,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -928,7 +933,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -955,7 +960,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1016,7 +1021,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1064,7 +1069,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1120,7 +1125,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1172,7 +1177,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1226,7 +1231,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1295,7 +1300,7 @@ async def generalize( # 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1341,7 +1346,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1426,7 +1431,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1514,7 +1519,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1597,7 +1602,7 @@ async def _power_off_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1658,7 +1663,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1711,7 +1716,7 @@ async def _reapply_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1764,7 +1769,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1816,7 +1821,7 @@ async def _restart_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1869,7 +1874,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1921,7 +1926,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1974,7 +1979,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2026,7 +2031,7 @@ async def _redeploy_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2079,7 +2084,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2135,7 +2140,7 @@ async def _reimage_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2285,7 +2290,7 @@ async def begin_reimage( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -2360,7 +2365,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2409,7 +2414,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2464,7 +2469,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2528,7 +2533,7 @@ async def simulate_eviction( # 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2572,7 +2577,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2635,7 +2640,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2691,7 +2696,7 @@ async def _run_command_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2844,7 +2849,7 @@ async def begin_run_command( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py index 39fd1cbf3e7a..ef68d4531b60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -78,8 +83,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py index e005cb72493c..db1e129a7b0f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py index 6f7e93867f7b..64ccd22f765f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -130,12 +135,17 @@ def build_delete_request( def build_get_request( - resource_group_name: str, host_group_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + host_group_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +176,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +204,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -329,7 +339,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -469,7 +479,7 @@ def 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -541,7 +551,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -573,7 +583,11 @@ def delete( # pylint: disable=inconsistent-return-statements @distributed_trace def get( - self, resource_group_name: str, host_group_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + host_group_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> _models.DedicatedHostGroup: """Retrieves information about a dedicated host group. @@ -601,7 +615,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -651,7 +665,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -732,7 +746,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py index 9871114c1a4b..2fcacc0785ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,13 +145,13 @@ def build_get_request( host_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_group_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -795,7 +800,7 @@ def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -825,7 +830,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -880,7 +885,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py index 01d9c3e9efff..1da7a8063c9b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py index 6d40b0611e0c..33c60899bf0b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py index da5357698905..7543ba630c6c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py index 78aa3adcf07b..f648860fd87b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ def 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py index 89edd43e4440..566ea115c888 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ def create( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ def 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py index 53309ba22e1f..2ca486fb8e37 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py index 4e8eae53a634..d40ac654b430 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py index 10faacd39db7..efc56b095251 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py index f97fa12ac4ca..ec38133eecf9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py index f41a1e04e090..1a8ec32d9896 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py index 15c5cbabbf63..84019fae6805 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 02f5dbf64f87..9a0b72b1a788 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 65947e90d134..8f4d982d2a93 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 4d687c5f32e4..11dda2a6848c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,7 +176,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py index 0d5ba83e0c3e..7ba1e42037d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,13 +194,13 @@ def build_get_request( instance_id: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -229,7 +234,7 @@ def build_get_instance_view_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +273,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +317,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -340,7 +345,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -366,7 +371,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -392,7 +397,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -425,7 +430,7 @@ def build_retrieve_boot_diagnostics_data_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -460,7 +465,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -486,7 +491,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -513,7 +518,7 @@ def build_run_command_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -580,7 +585,7 @@ def _reimage_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -742,7 +747,7 @@ def begin_reimage( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -798,7 +803,7 @@ def _reimage_all_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -857,7 +862,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -910,7 +915,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -970,7 +975,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1028,7 +1033,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1202,7 +1207,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1260,7 +1265,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1318,7 +1323,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1363,7 +1368,7 @@ def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -1393,7 +1398,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1457,7 +1462,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1528,7 +1533,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1619,7 +1624,7 @@ def _power_off_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1689,7 +1694,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1743,7 +1748,7 @@ def _restart_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1801,7 +1806,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1854,7 +1859,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1912,7 +1917,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1965,7 +1970,7 @@ def _redeploy_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2024,7 +2029,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2101,7 +2106,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2151,7 +2156,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2209,7 +2214,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2276,7 +2281,7 @@ def simulate_eviction( # 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2326,7 +2331,7 @@ def _run_command_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2490,7 +2495,7 @@ def begin_run_command( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py index 9bbb6a5dc253..da154d61eb0c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -382,7 +387,7 @@ def build_power_off_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -415,7 +420,7 @@ def build_restart_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -446,7 +451,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -477,7 +482,7 @@ def build_redeploy_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -508,7 +513,7 @@ def build_perform_maintenance_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -539,7 +544,7 @@ def build_update_instances_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +575,7 @@ def build_reimage_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -601,7 +606,7 @@ def build_reimage_all_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -637,7 +642,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -669,7 +674,7 @@ def build_convert_to_single_placement_group_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -700,7 +705,7 @@ def build_set_orchestration_service_state_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -762,7 +767,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -920,7 +925,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -981,7 +986,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1135,7 +1140,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1192,7 +1197,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1245,7 +1250,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1307,7 +1312,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1359,7 +1364,7 @@ def _deallocate_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1517,7 +1522,7 @@ def begin_deallocate( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -1576,7 +1581,7 @@ def _delete_instances_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1725,7 +1730,7 @@ def begin_delete_instances( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -1792,7 +1797,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1842,7 +1847,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1926,7 +1931,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2014,7 +2019,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2103,7 +2108,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2191,7 +2196,7 @@ def _power_off_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2365,7 +2370,7 @@ def begin_power_off( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -2425,7 +2430,7 @@ def _restart_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2577,7 +2582,7 @@ def begin_restart( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -2636,7 +2641,7 @@ def _start_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2788,7 +2793,7 @@ def begin_start( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -2847,7 +2852,7 @@ def _redeploy_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3002,7 +3007,7 @@ def begin_redeploy( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -3061,7 +3066,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3222,7 +3227,7 @@ def begin_perform_maintenance( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -3281,7 +3286,7 @@ def _update_instances_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3430,7 +3435,7 @@ def begin_update_instances( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -3489,7 +3494,7 @@ def _reimage_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3645,7 +3650,7 @@ def begin_reimage( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -3704,7 +3709,7 @@ def _reimage_all_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3859,7 +3864,7 @@ def begin_reimage_all( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -3930,7 +3935,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4060,7 +4065,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4120,7 +4125,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4268,7 +4273,7 @@ def begin_set_orchestration_service_state( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py index 21ff6e900153..a79bcfc10345 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py index 409a8d080aa7..686b877e669a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -197,12 +202,17 @@ def build_delete_request( def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -235,7 +245,7 @@ def build_instance_view_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +275,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -290,7 +300,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -315,7 +325,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -339,7 +349,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -367,7 +377,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[str] = _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +405,7 @@ def build_list_available_sizes_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -425,7 +435,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -451,7 +461,7 @@ def build_reapply_request(resource_group_name: str, vm_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -479,7 +489,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -502,7 +512,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -525,7 +535,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -549,7 +559,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -585,7 +595,7 @@ def build_retrieve_boot_diagnostics_data_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -619,7 +629,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -644,7 +654,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -670,7 +680,7 @@ def build_assess_patches_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -701,7 +711,7 @@ def build_run_command_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -763,7 +773,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -849,7 +859,7 @@ def _capture_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1009,7 +1019,7 @@ def begin_capture( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1068,7 +1078,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1223,7 +1233,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1290,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1432,7 +1442,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1489,7 +1499,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1548,7 +1558,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1589,7 +1599,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1616,7 +1626,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1677,7 +1687,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1725,7 +1735,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1779,7 +1789,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1831,7 +1841,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1885,7 +1895,7 @@ def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1954,7 +1964,7 @@ def generalize( # 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1999,7 +2009,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2083,7 +2093,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2170,7 +2180,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2253,7 +2263,7 @@ def _power_off_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2314,7 +2324,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2367,7 +2377,7 @@ def _reapply_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2420,7 +2430,7 @@ def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2472,7 +2482,7 @@ def _restart_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2525,7 +2535,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2577,7 +2587,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2630,7 +2640,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2682,7 +2692,7 @@ def _redeploy_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2735,7 +2745,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2791,7 +2801,7 @@ def _reimage_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2941,7 +2951,7 @@ def begin_reimage( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] 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] @@ -3016,7 +3026,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3065,7 +3075,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3118,7 +3128,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3182,7 +3192,7 @@ def simulate_eviction( # 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3226,7 +3236,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3289,7 +3299,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3345,7 +3355,7 @@ def _run_command_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3495,7 +3505,7 @@ def begin_run_command( _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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py index 95b096f0f69c..10fe16dc543f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-06-30") # type: str + api_version = kwargs.pop("api_version", "2020-06-30") # type: Literal["2020-06-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json index 454435f7daef..1fdd9e89758d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json @@ -102,4 +102,4 @@ "disk_encryption_sets": "DiskEncryptionSetsOperations", "disk_accesses": "DiskAccessesOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py index dd257a3e637e..3bb6b24ff175 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-06-30") # type: str + api_version = kwargs.pop("api_version", "2020-06-30") # type: Literal["2020-06-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py index ddf4a0071d00..57b5a8f0d35a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -237,7 +242,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -298,7 +303,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -462,7 +467,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -531,7 +536,7 @@ async def get(self, resource_group_name: str, disk_access_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -579,7 +584,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -636,7 +641,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -689,7 +694,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -770,7 +775,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -865,7 +870,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py index c54a63066ce1..6faa16fbe984 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py index 12b46b5e02f0..deeed6250aac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py index c2b37f9cf6e0..7c4daa33bc3f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py index 58862e406186..ab6f274a33f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +289,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -441,7 +446,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -502,7 +507,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -663,7 +668,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -732,7 +737,7 @@ def get(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -780,7 +785,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -835,7 +840,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -887,7 +892,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -967,7 +972,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1062,7 +1067,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py index bfeb6bb5ba87..0c33a797b7b7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py index 7a222413d641..1c59f1d74d49 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py index 7c09cf4388ff..637eacf1bd90 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py index 2a5b072f3671..e00b7a6e1ffb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-09-30") # type: str + api_version = kwargs.pop("api_version", "2020-09-30") # type: Literal["2020-09-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json index b4a2878640db..441d739da6fa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json @@ -112,4 +112,4 @@ "shared_gallery_images": "SharedGalleryImagesOperations", "shared_gallery_image_versions": "SharedGalleryImageVersionsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py index e30d50c21646..b620bd0fe203 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-09-30") # type: str + api_version = kwargs.pop("api_version", "2020-09-30") # type: Literal["2020-09-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py index bc4f0f850404..308978b9e2c9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] 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] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # pylint: disable=inco _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py index 4534e34666fb..09b98aeb0c12 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py index 2ee10335c790..4a95bf09e8bc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._disk_restore_point_operations import build_get_request, build_list_by_restore_point_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -155,7 +160,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py index 5afc7fbd5cb8..9d3acc023715 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py index 237bf0ee5bc6..169cdfe3e65c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -526,7 +531,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -575,7 +580,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -628,7 +633,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -680,7 +685,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -760,7 +765,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py index 24c470831fe0..54aafd1514b5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py index 38b0a70d3cf8..fcb7c1a61174 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py index 1da27ed48d92..1c220ff0c557 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py index 7837bba79dbf..9b4f907d6773 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py index 02f30846dbd4..e2afd62c6014 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._gallery_sharing_profile_operations import build_update_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -229,7 +234,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py index 96e35de8b706..151f000780b5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_galleries_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +78,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -166,7 +171,7 @@ async def get(self, location: str, gallery_unique_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py index 25f1ec934e79..c49ad2912a10 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_image_versions_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -194,7 +199,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py index f6d6c36b501c..a5be5056cc85 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_images_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -178,7 +183,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py index 827419cbbf14..ea8d78d89ff2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py index 33b1c2abb209..a5af7e755878 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] 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] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # pylint: disable=inconsiste _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py index c85c6e926b01..d39e6afa9ad7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py index 5d4c7e69924a..23df19106224 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +91,7 @@ def build_list_by_restore_point_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -234,7 +239,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py index 5c35d34b17d0..9c26098ce782 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py index 0756f147cbf9..779fc4a9d5f8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -117,7 +122,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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +265,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -420,7 +425,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -477,7 +482,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -628,7 +633,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -704,7 +709,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -753,7 +758,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -806,7 +811,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -858,7 +863,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -938,7 +943,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py index bf984a6eb996..d55ed02f7575 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py index f60c15a6fc22..65775d853151 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py index bd35cda0ec35..42e78eb358f3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py index f2f2f4ee04d3..6f37974e910b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py index 0eda2cabcccd..f41593c77288 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -263,7 +268,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py index 953fec43bddc..6dd6c0515599 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_get_request(location: str, gallery_unique_name: str, subscription_id: _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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -232,7 +237,7 @@ def get(self, location: str, gallery_unique_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py index e63a5d8a6644..30a1784388a2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -274,7 +279,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py index 7c2dffec8b98..1d3780a87d68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -249,7 +254,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py index 1b39fa2c7247..3c9ec588d767 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_configuration.py index 0918b14e2053..cd3601d87016 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-10-01-preview") # type: str + api_version = kwargs.pop("api_version", "2020-10-01-preview") # type: Literal["2020-10-01-preview"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_metadata.json index ba2c6698c1ed..423630627ef0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_metadata.json @@ -102,4 +102,4 @@ "cloud_services": "CloudServicesOperations", "cloud_services_update_domain": "CloudServicesUpdateDomainOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/_configuration.py index 33fcc9caf5cb..e4b73b5d0f67 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-10-01-preview") # type: str + api_version = kwargs.pop("api_version", "2020-10-01-preview") # type: Literal["2020-10-01-preview"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_role_instances_operations.py index 27d171d541e8..5aa666c4d207 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -41,6 +42,10 @@ build_restart_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -136,7 +143,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -181,7 +190,7 @@ async def get( role_instance_name: str, resource_group_name: str, cloud_service_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.RoleInstance: """Gets a role instance from a cloud service. @@ -211,7 +220,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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -275,7 +286,9 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -312,7 +325,11 @@ async def get_instance_view( @distributed_trace def list( - self, resource_group_name: str, cloud_service_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + cloud_service_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> AsyncIterable["_models.RoleInstance"]: """Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role @@ -334,7 +351,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -418,7 +437,9 @@ async def _restart_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -477,7 +498,9 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -530,7 +553,9 @@ async def _reimage_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -589,7 +614,9 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -642,7 +669,9 @@ async def _rebuild_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -702,7 +731,9 @@ async def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -769,7 +800,9 @@ async def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[AsyncIterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_roles_operations.py index 46ce715ad171..594255262029 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._cloud_service_roles_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -136,7 +143,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_operations.py index 3ed5f367068c..a7eddeff6b08 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,6 +47,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -252,7 +259,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +322,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -471,7 +482,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -528,7 +541,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -583,7 +598,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -645,7 +662,9 @@ async def get(self, resource_group_name: str, cloud_service_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -705,7 +724,9 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -754,7 +775,9 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -838,7 +861,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -920,7 +945,9 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -975,7 +1002,9 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1027,7 +1056,9 @@ async def _power_off_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1083,7 +1114,9 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1139,7 +1172,9 @@ async def _restart_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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1287,7 +1322,9 @@ async def begin_restart( _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -1346,7 +1383,9 @@ async def _reimage_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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1497,7 +1536,9 @@ async def begin_reimage( _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -1556,7 +1597,9 @@ async def _rebuild_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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1710,7 +1753,9 @@ async def begin_rebuild( _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -1769,7 +1814,9 @@ async def _delete_instances_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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1917,7 +1964,9 @@ async def begin_delete_instances( _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_update_domain_operations.py index a673b9ae5640..5972ae964d04 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -36,6 +37,10 @@ build_walk_update_domain_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,9 @@ async def _walk_update_domain_initial( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -242,7 +249,9 @@ async def begin_walk_update_domain( _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -316,7 +325,9 @@ async def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -370,7 +381,9 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_role_instances_operations.py index 19317281351e..0aef206622ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,13 +83,15 @@ def build_get_request( cloud_service_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +125,9 @@ def build_get_instance_view_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -147,13 +158,15 @@ def build_list_request( cloud_service_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +199,9 @@ def build_restart_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +233,9 @@ def build_reimage_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +267,9 @@ def build_rebuild_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +301,9 @@ def build_get_remote_desktop_file_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/x-rdp") # Construct URL @@ -341,7 +362,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -399,7 +422,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -444,7 +469,7 @@ def get( role_instance_name: str, resource_group_name: str, cloud_service_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.RoleInstance: """Gets a role instance from a cloud service. @@ -474,7 +499,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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -538,7 +565,9 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -575,7 +604,11 @@ def get_instance_view( @distributed_trace def list( - self, resource_group_name: str, cloud_service_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + cloud_service_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> Iterable["_models.RoleInstance"]: """Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role @@ -597,7 +630,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -681,7 +716,9 @@ def _restart_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -740,7 +777,9 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -793,7 +832,9 @@ def _reimage_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -852,7 +893,9 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +948,9 @@ def _rebuild_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -965,7 +1010,9 @@ def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1032,7 +1079,9 @@ def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Iterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_roles_operations.py index 673f80b39000..6912dc3fc9af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +81,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +155,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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -201,7 +212,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_operations.py index aefc94672d88..c20282efff97 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +85,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +121,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +187,9 @@ def build_get_instance_view_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +218,9 @@ def build_list_all_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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -227,7 +244,9 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +276,9 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +309,9 @@ def build_power_off_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +342,9 @@ def build_restart_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -353,7 +378,9 @@ def build_reimage_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -387,7 +414,9 @@ def build_rebuild_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -421,7 +450,9 @@ def build_delete_instances_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -486,7 +517,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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -651,7 +684,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -712,7 +747,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -870,7 +907,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -927,7 +966,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -980,7 +1021,9 @@ def begin_delete(self, resource_group_name: str, cloud_service_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1085,9 @@ def get(self, resource_group_name: str, cloud_service_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -1102,7 +1147,9 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -1151,7 +1198,9 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1235,7 +1284,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Clo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1317,7 +1368,9 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1370,7 +1423,9 @@ def begin_start(self, resource_group_name: str, cloud_service_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1422,7 +1477,9 @@ def _power_off_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1476,7 +1533,9 @@ def begin_power_off(self, resource_group_name: str, cloud_service_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1532,7 +1591,9 @@ def _restart_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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1680,7 +1741,9 @@ def begin_restart( _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -1739,7 +1802,9 @@ def _reimage_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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1890,7 +1955,9 @@ def begin_reimage( _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -1949,7 +2016,9 @@ def _rebuild_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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2103,7 +2172,9 @@ def begin_rebuild( _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -2162,7 +2233,9 @@ def _delete_instances_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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2310,7 +2383,9 @@ def begin_delete_instances( _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_update_domain_operations.py index ad8cd911d0a0..27f8999e19d9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_walk_update_domain_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +86,9 @@ def build_get_update_domain_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +120,9 @@ def build_list_update_domains_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +185,9 @@ def _walk_update_domain_initial( # pylint: disable=inconsistent-return-statemen _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -338,7 +351,9 @@ def begin_walk_update_domain( _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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -412,7 +427,9 @@ def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -466,7 +483,9 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_configuration.py index 416da770ae97..ec00b522689a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-12-01") # type: str + api_version = kwargs.pop("api_version", "2020-12-01") # type: Literal["2020-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_metadata.json index 7b2544844abf..47826164ee42 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_metadata.json @@ -125,4 +125,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/_configuration.py index 27fe2bbad656..20cb13517e09 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-12-01") # type: str + api_version = kwargs.pop("api_version", "2020-12-01") # type: Literal["2020-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_availability_sets_operations.py index 5c02c66aeef7..af55d212a318 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_host_groups_operations.py index 4e40b1096f0a..42bb14809ad2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -400,7 +405,11 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, host_group_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + host_group_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> _models.DedicatedHostGroup: """Retrieves information about a dedicated host group. @@ -428,7 +437,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -481,7 +490,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -563,7 +572,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_hosts_operations.py index 5ff23b8e0215..acac45d88249 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -638,7 +643,7 @@ async def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -668,7 +673,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -724,7 +729,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_accesses_operations.py index ccae6b4ee0f6..b9a447df8807 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # pylint: disable=inco _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_encryption_sets_operations.py index c06077ac8673..0c6635fcc5cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_restore_point_operations.py index 84370b0e8f0f..810d68ae0605 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -101,7 +106,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -162,7 +167,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -252,7 +257,7 @@ async def _grant_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -446,7 +451,7 @@ async def begin_grant_access( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -512,7 +517,7 @@ async def _revoke_access_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -584,7 +589,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disks_operations.py index 69c7360a6e65..5658a0554ce4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_images_operations.py index 49c59b5f03bd..f90d615b848d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_log_analytics_operations.py index 0bc7791c44b1..bb882c91b6ab 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_operations.py index 6fac217698ba..c4130626d5b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_proximity_placement_groups_operations.py index 4984758dc891..40f0a2af5528 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_snapshots_operations.py index 75413ea84936..14985f59b4b7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_ssh_public_keys_operations.py index e9de894eb325..ba25719f315b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_usage_operations.py index 9bfb4b6a4a72..7434c56f49aa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extension_images_operations.py index 17745fbbf887..4381e4588a61 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extensions_operations.py index 63b18f9a8366..efbd426c5d8b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index 92b9926386cf..964c043a9000 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_operations.py index 0a82dbd139d1..a20acf0f4177 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_run_commands_operations.py index d5ce61ce4b43..29c3ef1591bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index ff72fd78d907..9b8f695beeea 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index cf8d7f808824..c7ebe6bb688d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 3720d96197fb..f547b7e2cc6c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 48f58a443f59..8d511ecc7102 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index c9f67ec61ef3..a303d0607003 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -889,7 +894,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -919,7 +924,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -983,7 +988,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1054,7 +1059,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1145,7 +1150,7 @@ async def _power_off_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1215,7 +1220,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1269,7 +1274,7 @@ async def _restart_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1327,7 +1332,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1380,7 +1385,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1438,7 +1443,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1491,7 +1496,7 @@ async def _redeploy_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1550,7 +1555,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1627,7 +1632,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1677,7 +1682,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1735,7 +1740,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1802,7 +1807,7 @@ async def simulate_eviction( # 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1852,7 +1857,7 @@ async def _run_command_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2019,7 +2024,7 @@ async def begin_run_command( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_sets_operations.py index 421d8bf2d699..530d60539758 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -671,7 +676,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -736,7 +741,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -788,7 +793,7 @@ async def _deallocate_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -946,7 +951,7 @@ async def begin_deallocate( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -1006,7 +1011,7 @@ async def _delete_instances_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1168,7 +1173,7 @@ async def begin_delete_instances( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -1236,7 +1241,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1286,7 +1291,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1370,7 +1375,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1458,7 +1463,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1547,7 +1552,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1635,7 +1640,7 @@ async def _power_off_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1809,7 +1814,7 @@ async def begin_power_off( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -1869,7 +1874,7 @@ async def _restart_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2021,7 +2026,7 @@ async def begin_restart( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -2080,7 +2085,7 @@ async def _start_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2232,7 +2237,7 @@ async def begin_start( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -2291,7 +2296,7 @@ async def _redeploy_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2446,7 +2451,7 @@ async def begin_redeploy( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -2505,7 +2510,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2666,7 +2671,7 @@ async def begin_perform_maintenance( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -2725,7 +2730,7 @@ async def _update_instances_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2874,7 +2879,7 @@ async def begin_update_instances( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -2933,7 +2938,7 @@ async def _reimage_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3089,7 +3094,7 @@ async def begin_reimage( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -3148,7 +3153,7 @@ async def _reimage_all_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3303,7 +3308,7 @@ async def begin_reimage_all( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -3374,7 +3379,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3504,7 +3509,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3564,7 +3569,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3712,7 +3717,7 @@ async def begin_set_orchestration_service_state( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_sizes_operations.py index a4e960fc3502..d5549f81a0cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machines_operations.py index 99b9cb033df5..85ca56fed285 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -925,7 +930,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -952,7 +957,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1013,7 +1018,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1061,7 +1066,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1117,7 +1122,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1169,7 +1174,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1223,7 +1228,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1292,7 +1297,7 @@ async def generalize( # 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1338,7 +1343,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1423,7 +1428,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1511,7 +1516,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1594,7 +1599,7 @@ async def _power_off_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1655,7 +1660,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1708,7 +1713,7 @@ async def _reapply_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1761,7 +1766,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1813,7 +1818,7 @@ async def _restart_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1866,7 +1871,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1918,7 +1923,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1971,7 +1976,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2023,7 +2028,7 @@ async def _redeploy_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2076,7 +2081,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2132,7 +2137,7 @@ async def _reimage_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2282,7 +2287,7 @@ async def begin_reimage( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -2357,7 +2362,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2406,7 +2411,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2461,7 +2466,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2525,7 +2530,7 @@ async def simulate_eviction( # 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2569,7 +2574,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2632,7 +2637,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2692,7 +2697,7 @@ async def _install_patches_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2853,7 +2858,7 @@ async def begin_install_patches( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2912,7 +2917,7 @@ async def _run_command_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3065,7 +3070,7 @@ async def begin_run_command( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/models/_models_py3.py index f10ac06bd4a8..3f0ee834b7fd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -101,8 +106,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_availability_sets_operations.py index f8c13538f880..054b94528283 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_host_groups_operations.py index 8e030785eaeb..466c5ed084cc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -130,12 +135,17 @@ def build_delete_request( def build_get_request( - resource_group_name: str, host_group_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + host_group_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +176,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +204,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -329,7 +339,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -469,7 +479,7 @@ def 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -541,7 +551,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -573,7 +583,11 @@ def delete( # pylint: disable=inconsistent-return-statements @distributed_trace def get( - self, resource_group_name: str, host_group_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + host_group_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> _models.DedicatedHostGroup: """Retrieves information about a dedicated host group. @@ -601,7 +615,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -651,7 +665,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -732,7 +746,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_hosts_operations.py index 9edf1dd3b2fd..a4a1656ff0ea 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,13 +145,13 @@ def build_get_request( host_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_group_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -795,7 +800,7 @@ def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -825,7 +830,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -880,7 +885,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_accesses_operations.py index 2bee8ec46c86..8482350fe62e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # pylint: disable=inconsiste _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_encryption_sets_operations.py index 7fbab7d7d5b2..e19392699a0c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_restore_point_operations.py index 201b4bc3c653..d2ade7e5ba97 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -319,7 +324,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -409,7 +414,7 @@ def _grant_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -600,7 +605,7 @@ def begin_grant_access( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -666,7 +671,7 @@ def _revoke_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -738,7 +743,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py index 9f36feca85f4..ee1c64026329 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_images_operations.py index fd33f981840c..7aedcfbd746c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_log_analytics_operations.py index 06a919a850d1..01f701f75f13 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_operations.py index c983c6db1de0..97f940c988a6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_proximity_placement_groups_operations.py index ce89bf70eae2..5ad6f0c85def 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ def 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_snapshots_operations.py index e68bd0d9f2a7..cb9218a92600 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_ssh_public_keys_operations.py index 023ecda33b7e..55ff767bd9a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ def create( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ def 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_usage_operations.py index 55e6c1a1e146..08c6afedb6c8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extension_images_operations.py index bbf2bb2ce58e..8e757f928834 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extensions_operations.py index adeab331d1c8..eec8aac7fb9e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_edge_zone_operations.py index 59da655a9adc..3028fe5ba767 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: str, subscription_id _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_operations.py index 1be0e3d4f5b3..a2b4cfaaf84f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_run_commands_operations.py index d26a426c3506..3a7967e12fa2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_extensions_operations.py index 45e7e121485d..4bc3454058ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index f9102ed8f77b..2195b837cde1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 760ed65bac8d..bf5929713ba1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 81b966c0fe04..7500689e7687 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,7 +176,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vms_operations.py index fe5192e9a6bb..b890afb8bf39 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -168,7 +173,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -197,13 +202,13 @@ def build_get_request( instance_id: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_get_instance_view_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -276,7 +281,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -348,7 +353,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -374,7 +379,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -400,7 +405,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -433,7 +438,7 @@ def build_retrieve_boot_diagnostics_data_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -468,7 +473,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -494,7 +499,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -521,7 +526,7 @@ def build_run_command_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -588,7 +593,7 @@ def _reimage_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -750,7 +755,7 @@ def begin_reimage( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -806,7 +811,7 @@ def _reimage_all_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -865,7 +870,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -918,7 +923,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -978,7 +983,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1210,7 +1215,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1273,7 +1278,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1340,7 +1345,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1386,7 +1391,7 @@ def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -1416,7 +1421,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1480,7 +1485,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1551,7 +1556,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1642,7 +1647,7 @@ def _power_off_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1712,7 +1717,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1766,7 +1771,7 @@ def _restart_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1824,7 +1829,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1877,7 +1882,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1935,7 +1940,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1988,7 +1993,7 @@ def _redeploy_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2047,7 +2052,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2124,7 +2129,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2174,7 +2179,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2232,7 +2237,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2299,7 +2304,7 @@ def simulate_eviction( # 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2349,7 +2354,7 @@ def _run_command_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2513,7 +2518,7 @@ def begin_run_command( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_sets_operations.py index 3e5a117b0cf5..ea75f16eed7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -144,7 +149,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -172,7 +177,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +208,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -239,7 +244,7 @@ def build_delete_instances_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -272,7 +277,7 @@ def build_get_instance_view_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -301,7 +306,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -329,7 +334,7 @@ def build_list_all_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -357,7 +362,7 @@ def build_list_skus_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -388,7 +393,7 @@ def build_get_os_upgrade_history_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -424,7 +429,7 @@ def build_power_off_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -457,7 +462,7 @@ def build_restart_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -488,7 +493,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -519,7 +524,7 @@ def build_redeploy_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -550,7 +555,7 @@ def build_perform_maintenance_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -581,7 +586,7 @@ def build_update_instances_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -612,7 +617,7 @@ def build_reimage_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -643,7 +648,7 @@ def build_reimage_all_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -679,7 +684,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -711,7 +716,7 @@ def build_convert_to_single_placement_group_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -742,7 +747,7 @@ def build_set_orchestration_service_state_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -803,7 +808,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -889,7 +894,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1047,7 +1052,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1108,7 +1113,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1262,7 +1267,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1319,7 +1324,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1378,7 +1383,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1441,7 +1446,7 @@ def get(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1493,7 +1498,7 @@ def _deallocate_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1651,7 +1656,7 @@ def begin_deallocate( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -1711,7 +1716,7 @@ def _delete_instances_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1873,7 +1878,7 @@ def begin_delete_instances( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -1941,7 +1946,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1991,7 +1996,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2075,7 +2080,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2163,7 +2168,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2252,7 +2257,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2340,7 +2345,7 @@ def _power_off_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2514,7 +2519,7 @@ def begin_power_off( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -2574,7 +2579,7 @@ def _restart_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2726,7 +2731,7 @@ def begin_restart( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -2785,7 +2790,7 @@ def _start_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2937,7 +2942,7 @@ def begin_start( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -2996,7 +3001,7 @@ def _redeploy_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3151,7 +3156,7 @@ def begin_redeploy( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -3210,7 +3215,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3371,7 +3376,7 @@ def begin_perform_maintenance( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -3430,7 +3435,7 @@ def _update_instances_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3579,7 +3584,7 @@ def begin_update_instances( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -3638,7 +3643,7 @@ def _reimage_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3794,7 +3799,7 @@ def begin_reimage( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -3853,7 +3858,7 @@ def _reimage_all_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4008,7 +4013,7 @@ def begin_reimage_all( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -4079,7 +4084,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4209,7 +4214,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4269,7 +4274,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4417,7 +4422,7 @@ def begin_set_orchestration_service_state( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_sizes_operations.py index a65688a7bfd0..5d0745fe1147 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machines_operations.py index c0ffe6faaae7..6ebabd3dc0af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -197,12 +202,17 @@ def build_delete_request( def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -235,7 +245,7 @@ def build_instance_view_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +275,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -290,7 +300,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -315,7 +325,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -339,7 +349,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -367,7 +377,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[str] = _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +405,7 @@ def build_list_available_sizes_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -425,7 +435,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -451,7 +461,7 @@ def build_reapply_request(resource_group_name: str, vm_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -479,7 +489,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -502,7 +512,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -525,7 +535,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -549,7 +559,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -585,7 +595,7 @@ def build_retrieve_boot_diagnostics_data_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -619,7 +629,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -644,7 +654,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -670,7 +680,7 @@ def build_assess_patches_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -701,7 +711,7 @@ def build_install_patches_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -735,7 +745,7 @@ def build_run_command_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -797,7 +807,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -883,7 +893,7 @@ def _capture_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1043,7 +1053,7 @@ def begin_capture( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1102,7 +1112,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1257,7 +1267,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1314,7 +1324,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1462,7 +1472,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1519,7 +1529,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1578,7 +1588,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1619,7 +1629,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1646,7 +1656,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1707,7 +1717,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1755,7 +1765,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1809,7 +1819,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1861,7 +1871,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1915,7 +1925,7 @@ def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1984,7 +1994,7 @@ def generalize( # 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2029,7 +2039,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2113,7 +2123,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2200,7 +2210,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2283,7 +2293,7 @@ def _power_off_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2344,7 +2354,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2397,7 +2407,7 @@ def _reapply_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2450,7 +2460,7 @@ def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2502,7 +2512,7 @@ def _restart_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2555,7 +2565,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2607,7 +2617,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2660,7 +2670,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2712,7 +2722,7 @@ def _redeploy_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2765,7 +2775,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2821,7 +2831,7 @@ def _reimage_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2971,7 +2981,7 @@ def begin_reimage( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] 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] @@ -3046,7 +3056,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3095,7 +3105,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3148,7 +3158,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3212,7 +3222,7 @@ def simulate_eviction( # 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3256,7 +3266,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3319,7 +3329,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3379,7 +3389,7 @@ def _install_patches_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3540,7 +3550,7 @@ def begin_install_patches( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3599,7 +3609,7 @@ def _run_command_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3749,7 +3759,7 @@ def begin_run_command( _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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_configuration.py index 7224446e04a7..41190fdb653c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-03-01") # type: str + api_version = kwargs.pop("api_version", "2021-03-01") # type: Literal["2021-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_metadata.json index 02c99d62b0f8..78bc32e05d29 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_metadata.json @@ -127,4 +127,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py index 801b6af1f885..509f3fa56234 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-03-01") # type: str + api_version = kwargs.pop("api_version", "2021-03-01") # type: Literal["2021-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_availability_sets_operations.py index cfcc12e60616..405f70f4009e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_operating_systems_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_operating_systems_operations.py index 6222d0e820fc..1cfe18718b1d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_operating_systems_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_operating_systems_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -35,6 +36,10 @@ build_list_os_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ async def get_os_version(self, location: str, os_version_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersion] request = build_get_os_version_request( @@ -134,7 +139,7 @@ def list_os_versions(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersionListResult] error_map = { @@ -227,7 +232,7 @@ async def get_os_family(self, location: str, os_family_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamily] request = build_get_os_family_request( @@ -278,7 +283,7 @@ def list_os_families(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamilyListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_role_instances_operations.py index ad262c64529e..dea565ecc032 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -41,6 +42,10 @@ build_restart_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -136,7 +141,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -211,7 +216,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -275,7 +280,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -338,7 +343,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -422,7 +427,7 @@ async def _restart_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -481,7 +486,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -534,7 +539,7 @@ async def _reimage_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -593,7 +598,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -646,7 +651,7 @@ async def _rebuild_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -706,7 +711,7 @@ async def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -773,7 +778,7 @@ async def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[AsyncIterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_roles_operations.py index 9b6d3bfb00a8..908d505f36d9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._cloud_service_roles_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -136,7 +141,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_operations.py index 53cda9307413..a253ace354a2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,6 +47,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -249,7 +254,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -310,7 +315,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -465,7 +470,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -577,7 +582,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -639,7 +644,7 @@ async def get(self, resource_group_name: str, cloud_service_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -699,7 +704,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -748,7 +753,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -832,7 +837,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -914,7 +919,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -969,7 +974,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1021,7 +1026,7 @@ async def _power_off_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1077,7 +1082,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1133,7 +1138,7 @@ async def _restart_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1281,7 +1286,7 @@ async def begin_restart( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -1340,7 +1345,7 @@ async def _reimage_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1491,7 +1496,7 @@ async def begin_reimage( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -1550,7 +1555,7 @@ async def _rebuild_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1704,7 +1709,7 @@ async def begin_rebuild( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -1763,7 +1768,7 @@ async def _delete_instances_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1911,7 +1916,7 @@ async def begin_delete_instances( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_update_domain_operations.py index 00aea69369bc..c03f077c0064 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -36,6 +37,10 @@ build_walk_update_domain_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _walk_update_domain_initial( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -242,7 +247,7 @@ async def begin_walk_update_domain( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -316,7 +321,7 @@ async def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -370,7 +375,7 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_host_groups_operations.py index e55c7de0e408..91190b4c1b45 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -433,7 +438,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_hosts_operations.py index dccb98b1fcd4..2c2b0beac9a7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -725,7 +730,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_images_operations.py index bbd77f26d022..6e1266c7c816 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_log_analytics_operations.py index 74dc048c2d69..95c59ae2e4f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_operations.py index d71e2eeb9757..f5b9cc6454b6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_proximity_placement_groups_operations.py index 5190855aa4e1..c25aa51123e5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_point_collections_operations.py index 40dc894bb2ec..1517993ee8cb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -303,7 +308,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -364,7 +369,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -421,7 +426,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -493,7 +498,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -545,7 +550,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -630,7 +635,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_points_operations.py index f3a860def1f6..048eabca7882 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_request, build_delete_request, build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -237,7 +242,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -295,7 +300,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -354,7 +359,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_ssh_public_keys_operations.py index c54b8db485a7..8a0befecc782 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_usage_operations.py index 2da4018a80a1..157aff99fdc7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extension_images_operations.py index 31b70b8323b3..b322c200238d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extensions_operations.py index 7508e01c86a5..62b3ae207118 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index eb3ff6e4aff7..6e5b6dcbbd75 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -179,7 +184,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -249,7 +254,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -311,7 +316,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -377,7 +382,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_operations.py index 8cf46bdfef7c..6202fc83a9e5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_run_commands_operations.py index 4fbe2b312f4b..233ccd44adf4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -399,7 +404,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -462,7 +467,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -633,7 +638,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -691,7 +696,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -751,7 +756,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -820,7 +825,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -879,7 +884,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index aeafa65cc128..ed0fbfb40a28 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index cd12c7c23007..4cde1d3c3f3b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 9f67a58c6746..f108da1d74f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -262,7 +267,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -507,7 +512,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -566,7 +571,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -628,7 +633,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -706,7 +711,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -779,7 +784,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 15d176147d6c..ba9688ae6df0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -263,7 +268,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -328,7 +333,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -506,7 +511,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -565,7 +570,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -627,7 +632,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -705,7 +710,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -772,7 +777,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 1f37f7484580..ba535851ed0c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1679,7 +1684,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1737,7 +1742,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1804,7 +1809,7 @@ async def simulate_eviction( # 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1854,7 +1859,7 @@ async def _run_command_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2021,7 +2026,7 @@ async def begin_run_command( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_sets_operations.py index da53a51c6325..4c9dbc0bd0ca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -183,7 +188,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -341,7 +346,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -556,7 +561,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -613,7 +618,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -672,7 +677,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -798,7 +803,7 @@ async def _deallocate_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -956,7 +961,7 @@ async def begin_deallocate( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -1016,7 +1021,7 @@ async def _delete_instances_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1178,7 +1183,7 @@ async def begin_delete_instances( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -1246,7 +1251,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1296,7 +1301,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1380,7 +1385,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1468,7 +1473,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1557,7 +1562,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1645,7 +1650,7 @@ async def _power_off_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1819,7 +1824,7 @@ async def begin_power_off( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -1879,7 +1884,7 @@ async def _restart_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2031,7 +2036,7 @@ async def begin_restart( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -2090,7 +2095,7 @@ async def _start_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2242,7 +2247,7 @@ async def begin_start( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -2301,7 +2306,7 @@ async def _redeploy_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2456,7 +2461,7 @@ async def begin_redeploy( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -2515,7 +2520,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2676,7 +2681,7 @@ async def begin_perform_maintenance( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -2735,7 +2740,7 @@ async def _update_instances_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2884,7 +2889,7 @@ async def begin_update_instances( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -2943,7 +2948,7 @@ async def _reimage_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3099,7 +3104,7 @@ async def begin_reimage( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -3158,7 +3163,7 @@ async def _reimage_all_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3313,7 +3318,7 @@ async def begin_reimage_all( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -3384,7 +3389,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3514,7 +3519,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3574,7 +3579,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3722,7 +3727,7 @@ async def begin_set_orchestration_service_state( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_sizes_operations.py index 2c39502384d6..1a28435390f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machines_operations.py index f3543c13e508..3c0c26ac462b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1230,7 +1235,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1299,7 +1304,7 @@ async def generalize( # 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1345,7 +1350,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1430,7 +1435,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1518,7 +1523,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1601,7 +1606,7 @@ async def _power_off_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1662,7 +1667,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1715,7 +1720,7 @@ async def _reapply_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1769,7 +1774,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1821,7 +1826,7 @@ async def _restart_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1874,7 +1879,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1926,7 +1931,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1979,7 +1984,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2031,7 +2036,7 @@ async def _redeploy_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2084,7 +2089,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2140,7 +2145,7 @@ async def _reimage_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2290,7 +2295,7 @@ async def begin_reimage( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -2365,7 +2370,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2415,7 +2420,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2470,7 +2475,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2534,7 +2539,7 @@ async def simulate_eviction( # 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2578,7 +2583,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2642,7 +2647,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2702,7 +2707,7 @@ async def _install_patches_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2864,7 +2869,7 @@ async def begin_install_patches( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2923,7 +2928,7 @@ async def _run_command_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3076,7 +3081,7 @@ async def begin_run_command( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py index 97d9a136fc7c..fc0f51294bb0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -78,8 +83,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_availability_sets_operations.py index 91dc9bb6e0f1..0253924526cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_operating_systems_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_operating_systems_operations.py index 7a1682925e2f..082c2e170d59 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_operating_systems_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_operating_systems_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_get_os_version_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_os_versions_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +104,7 @@ def build_get_os_family_request(location: str, os_family_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +133,7 @@ def build_list_os_families_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -196,7 +201,7 @@ def get_os_version(self, location: str, os_version_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersion] request = build_get_os_version_request( @@ -246,7 +251,7 @@ def list_os_versions(self, location: str, **kwargs: Any) -> Iterable["_models.OS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersionListResult] error_map = { @@ -339,7 +344,7 @@ def get_os_family(self, location: str, os_family_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamily] request = build_get_os_family_request( @@ -389,7 +394,7 @@ def list_os_families(self, location: str, **kwargs: Any) -> Iterable["_models.OS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamilyListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_role_instances_operations.py index 3f4423f58f89..fbba0a7a859c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +87,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +121,7 @@ def build_get_instance_view_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +158,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_restart_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_reimage_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +255,7 @@ def build_rebuild_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +287,7 @@ def build_get_remote_desktop_file_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/x-rdp") # Construct URL @@ -341,7 +346,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -399,7 +404,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -474,7 +479,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -538,7 +543,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -600,7 +605,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -684,7 +689,7 @@ def _restart_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -743,7 +748,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -796,7 +801,7 @@ def _reimage_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -855,7 +860,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -908,7 +913,7 @@ def _rebuild_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -968,7 +973,7 @@ def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[Iterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_roles_operations.py index 857b132f92fd..2b9e721745d1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +79,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -200,7 +205,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_operations.py index da23cb038a2e..dad15f52ba55 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def build_get_instance_view_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +208,7 @@ def build_list_all_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -227,7 +232,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +262,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def build_power_off_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +324,7 @@ def build_restart_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -353,7 +358,7 @@ def build_reimage_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -387,7 +392,7 @@ def build_rebuild_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -421,7 +426,7 @@ def build_delete_instances_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -486,7 +491,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -648,7 +653,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -709,7 +714,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -864,7 +869,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -921,7 +926,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -974,7 +979,7 @@ def begin_delete(self, resource_group_name: str, cloud_service_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ def get(self, resource_group_name: str, cloud_service_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -1096,7 +1101,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -1144,7 +1149,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1227,7 +1232,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Clo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1309,7 +1314,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1362,7 +1367,7 @@ def begin_start(self, resource_group_name: str, cloud_service_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1414,7 +1419,7 @@ def _power_off_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1468,7 +1473,7 @@ def begin_power_off(self, resource_group_name: str, cloud_service_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1524,7 +1529,7 @@ def _restart_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1672,7 +1677,7 @@ def begin_restart( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -1731,7 +1736,7 @@ def _reimage_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1882,7 +1887,7 @@ def begin_reimage( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -1941,7 +1946,7 @@ def _rebuild_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2095,7 +2100,7 @@ def begin_rebuild( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -2154,7 +2159,7 @@ def _delete_instances_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2302,7 +2307,7 @@ def begin_delete_instances( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_update_domain_operations.py index c6b4a228d297..70f5d780868c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_walk_update_domain_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_get_update_domain_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_list_update_domains_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def _walk_update_domain_initial( # pylint: disable=inconsistent-return-statemen _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -338,7 +343,7 @@ def begin_walk_update_domain( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -412,7 +417,7 @@ def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -465,7 +470,7 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_host_groups_operations.py index 627c13e84d0c..b81895179166 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,7 +145,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +176,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +204,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -334,7 +339,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -474,7 +479,7 @@ def 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -546,7 +551,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -661,7 +666,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -742,7 +747,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_hosts_operations.py index 3601a3082164..b40aba824596 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_group_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -881,7 +886,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_images_operations.py index aa5bc1fd2fd0..c99125a733a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_log_analytics_operations.py index 150fd072a58f..92b626dd559a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_operations.py index 9b918dab6fa7..c0bef4ceb7ef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_proximity_placement_groups_operations.py index 8f282710cde0..b81b1a4e99cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ def 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_point_collections_operations.py index 7027ef8ed29a..4166d7238a30 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -497,7 +502,7 @@ def 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -558,7 +563,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -615,7 +620,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -687,7 +692,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -739,7 +744,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -824,7 +829,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_points_operations.py index b18b8885ad0d..dc126dea5f45 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +130,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -357,7 +362,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -415,7 +420,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -474,7 +479,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -541,7 +546,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_ssh_public_keys_operations.py index 5fec38cf5c87..1f20a9ed8148 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ def create( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ def 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_usage_operations.py index 512856e633b0..800dc542e35d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extension_images_operations.py index a50949cb5983..3cd60741e0a3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extensions_operations.py index ea35716a0b65..d36f9130e655 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_edge_zone_operations.py index c1e8f4bcdde1..f1e6aff22ef7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: str, subscription_id _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -362,7 +367,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -432,7 +437,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -494,7 +499,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -560,7 +565,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_operations.py index d232fe7ae556..1edb3c4757e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_run_commands_operations.py index 2f7d0df6069a..080e34316ead 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -624,7 +629,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -687,7 +692,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -858,7 +863,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -916,7 +921,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -976,7 +981,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1045,7 +1050,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1104,7 +1109,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py index dd80820e99ca..84a5057ef79b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 3921142330e4..2a6020f7396f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 90c41a52d410..66cf66362f2a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -461,7 +466,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -526,7 +531,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -706,7 +711,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -765,7 +770,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -827,7 +832,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -978,7 +983,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index ab68116a5a7b..e0c0ea17f9f3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,7 +176,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -461,7 +466,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -526,7 +531,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -704,7 +709,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -825,7 +830,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -903,7 +908,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -970,7 +975,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vms_operations.py index c415da08175a..6b6f5454df38 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -168,7 +173,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -203,7 +208,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_get_instance_view_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -276,7 +281,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -348,7 +353,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -374,7 +379,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -400,7 +405,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -433,7 +438,7 @@ def build_retrieve_boot_diagnostics_data_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -468,7 +473,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -494,7 +499,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -521,7 +526,7 @@ def build_run_command_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -588,7 +593,7 @@ def _reimage_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -750,7 +755,7 @@ def begin_reimage( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -806,7 +811,7 @@ def _reimage_all_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -865,7 +870,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -918,7 +923,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -978,7 +983,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1210,7 +1215,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1273,7 +1278,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1340,7 +1345,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1417,7 +1422,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1481,7 +1486,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1552,7 +1557,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1643,7 +1648,7 @@ def _power_off_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1713,7 +1718,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1767,7 +1772,7 @@ def _restart_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1825,7 +1830,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1878,7 +1883,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1936,7 +1941,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1989,7 +1994,7 @@ def _redeploy_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2048,7 +2053,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2125,7 +2130,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2176,7 +2181,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2234,7 +2239,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2301,7 +2306,7 @@ def simulate_eviction( # 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2351,7 +2356,7 @@ def _run_command_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2515,7 +2520,7 @@ def begin_run_command( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_sets_operations.py index cd5f58bd7927..55b04bc95070 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -144,7 +149,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -177,7 +182,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -246,7 +251,7 @@ def build_delete_instances_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -279,7 +284,7 @@ def build_get_instance_view_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,7 +341,7 @@ def build_list_all_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -364,7 +369,7 @@ def build_list_skus_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +400,7 @@ def build_get_os_upgrade_history_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -431,7 +436,7 @@ def build_power_off_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -464,7 +469,7 @@ def build_restart_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -495,7 +500,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -526,7 +531,7 @@ def build_redeploy_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -557,7 +562,7 @@ def build_perform_maintenance_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -588,7 +593,7 @@ def build_update_instances_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -619,7 +624,7 @@ def build_reimage_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -650,7 +655,7 @@ def build_reimage_all_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -686,7 +691,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -718,7 +723,7 @@ def build_convert_to_single_placement_group_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -749,7 +754,7 @@ def build_set_orchestration_service_state_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -810,7 +815,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -897,7 +902,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1055,7 +1060,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1116,7 +1121,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1270,7 +1275,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1327,7 +1332,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1386,7 +1391,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1459,7 +1464,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1512,7 +1517,7 @@ def _deallocate_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1670,7 +1675,7 @@ def begin_deallocate( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -1730,7 +1735,7 @@ def _delete_instances_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1892,7 +1897,7 @@ def begin_delete_instances( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -1960,7 +1965,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2010,7 +2015,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2094,7 +2099,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2182,7 +2187,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2271,7 +2276,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2359,7 +2364,7 @@ def _power_off_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2533,7 +2538,7 @@ def begin_power_off( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -2593,7 +2598,7 @@ def _restart_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2745,7 +2750,7 @@ def begin_restart( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -2804,7 +2809,7 @@ def _start_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2956,7 +2961,7 @@ def begin_start( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -3015,7 +3020,7 @@ def _redeploy_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3170,7 +3175,7 @@ def begin_redeploy( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -3229,7 +3234,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3390,7 +3395,7 @@ def begin_perform_maintenance( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -3449,7 +3454,7 @@ def _update_instances_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3598,7 +3603,7 @@ def begin_update_instances( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -3657,7 +3662,7 @@ def _reimage_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3813,7 +3818,7 @@ def begin_reimage( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -3872,7 +3877,7 @@ def _reimage_all_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4027,7 +4032,7 @@ def begin_reimage_all( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -4098,7 +4103,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4228,7 +4233,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4288,7 +4293,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4436,7 +4441,7 @@ def begin_set_orchestration_service_state( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_sizes_operations.py index 02d9a587384d..1a8c5509921f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machines_operations.py index 505594b515d8..aaaac4da8059 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -207,7 +212,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +245,7 @@ def build_instance_view_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,7 +275,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -295,7 +300,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -320,7 +325,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -344,7 +349,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +377,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[str] = _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -400,7 +405,7 @@ def build_list_available_sizes_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -430,7 +435,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -456,7 +461,7 @@ def build_reapply_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -484,7 +489,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -507,7 +512,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -530,7 +535,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -554,7 +559,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -590,7 +595,7 @@ def build_retrieve_boot_diagnostics_data_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -624,7 +629,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -649,7 +654,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -675,7 +680,7 @@ def build_assess_patches_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -706,7 +711,7 @@ def build_install_patches_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -740,7 +745,7 @@ def build_run_command_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -802,7 +807,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -888,7 +893,7 @@ def _capture_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1048,7 +1053,7 @@ def begin_capture( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1107,7 +1112,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1262,7 +1267,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1319,7 +1324,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1467,7 +1472,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1524,7 +1529,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1583,7 +1588,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1658,7 +1663,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1719,7 +1724,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1767,7 +1772,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1821,7 +1826,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1873,7 +1878,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1927,7 +1932,7 @@ def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1996,7 +2001,7 @@ def generalize( # 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2041,7 +2046,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2125,7 +2130,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2212,7 +2217,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2295,7 +2300,7 @@ def _power_off_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2356,7 +2361,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2409,7 +2414,7 @@ def _reapply_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2463,7 +2468,7 @@ def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2515,7 +2520,7 @@ def _restart_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2568,7 +2573,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2620,7 +2625,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2673,7 +2678,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2725,7 +2730,7 @@ def _redeploy_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2778,7 +2783,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2834,7 +2839,7 @@ def _reimage_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2984,7 +2989,7 @@ def begin_reimage( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] 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] @@ -3059,7 +3064,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3109,7 +3114,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3162,7 +3167,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3226,7 +3231,7 @@ def simulate_eviction( # 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3270,7 +3275,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3334,7 +3339,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3394,7 +3399,7 @@ def _install_patches_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3556,7 +3561,7 @@ def begin_install_patches( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3615,7 +3620,7 @@ def _run_command_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3765,7 +3770,7 @@ def begin_run_command( _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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_configuration.py index b99e24f4e365..9cf839a332c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-04-01") # type: str + api_version = kwargs.pop("api_version", "2021-04-01") # type: Literal["2021-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_metadata.json index dc7373170263..d8e056bb7218 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_metadata.json @@ -129,4 +129,4 @@ "disk_accesses": "DiskAccessesOperations", "disk_restore_point": "DiskRestorePointOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/_configuration.py index ca3d52402e13..0b74d343c264 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-04-01") # type: str + api_version = kwargs.pop("api_version", "2021-04-01") # type: Literal["2021-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_availability_sets_operations.py index aca3e6961de7..880647c85d75 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservation_groups_operations.py index bf92ca8843e6..5257e7af9955 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -301,7 +306,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -376,7 +381,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -443,7 +448,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -506,7 +511,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -598,7 +603,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservations_operations.py index b0b5324f92ea..d98407c10b86 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -255,7 +260,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -318,7 +323,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.CapacityReservation]] @@ -485,7 +490,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -744,7 +749,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_host_groups_operations.py index 29ca01d344c4..4bc5e026bf84 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -433,7 +438,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_hosts_operations.py index a4ac4e9bedf4..a461f0b36478 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -725,7 +730,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_accesses_operations.py index d79be134a75d..2f43404420b2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # pylint: disable=inco _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_encryption_sets_operations.py index 43cc329fdadf..913a6edcd14b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_restore_point_operations.py index ab1b6a394145..ac6953a054eb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -156,7 +161,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -246,7 +251,7 @@ async def _grant_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.AccessUri]] @@ -428,7 +433,7 @@ async def begin_grant_access( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -494,7 +499,7 @@ async def _revoke_access_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -562,7 +567,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disks_operations.py index 12e8103471f6..2d9c776a6c14 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_images_operations.py index 8c3242b0d7f3..2d477765e02e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_log_analytics_operations.py index 01958ec79b3c..a725963aeeac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_operations.py index 0c6b22ca6538..b23a5e32a875 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_proximity_placement_groups_operations.py index af3d5b08f59e..b20fb4abdf7e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_point_collections_operations.py index f30344d40813..94bff20a19bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -302,7 +307,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -362,7 +367,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -418,7 +423,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -490,7 +495,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -541,7 +546,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -625,7 +630,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_points_operations.py index 0a3469cf8d04..273356869a04 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_request, build_delete_request, build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -236,7 +241,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -294,7 +299,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -352,7 +357,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_snapshots_operations.py index ff5704f0f462..fc08d7e78bc2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_ssh_public_keys_operations.py index 5570fc01292e..19e5fb593f80 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_usage_operations.py index a4c5b4e58cde..76db971104c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extension_images_operations.py index cb1d0907d651..9f2ee993aeb7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extensions_operations.py index 3cfe188cf82b..05db035368fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index fc9f286291dc..6a7e936a0cd6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_operations.py index c9600c350160..795016d95120 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_run_commands_operations.py index 49026c26f133..f65b43b3e7d7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 6931fc13cf88..f91532c8f52f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index fa32e4997c98..19176e666d5a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 8d2b307233e7..daadfa346b70 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 047d3eb8fb88..96b16d26b9d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 9fe3958f89dc..34097d5f5e8f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1678,7 +1683,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1736,7 +1741,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def simulate_eviction( # 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1853,7 +1858,7 @@ async def _run_command_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.RunCommandResult]] @@ -2020,7 +2025,7 @@ async def begin_run_command( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_sets_operations.py index b64b13465c89..8173f3aa85af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -671,7 +676,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,7 +749,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -797,7 +802,7 @@ async def _deallocate_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -955,7 +960,7 @@ async def begin_deallocate( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -1015,7 +1020,7 @@ async def _delete_instances_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1177,7 +1182,7 @@ async def begin_delete_instances( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -1245,7 +1250,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1295,7 +1300,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1379,7 +1384,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1467,7 +1472,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1556,7 +1561,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1644,7 +1649,7 @@ async def _power_off_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1818,7 +1823,7 @@ async def begin_power_off( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -1878,7 +1883,7 @@ async def _restart_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2030,7 +2035,7 @@ async def begin_restart( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -2089,7 +2094,7 @@ async def _start_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2241,7 +2246,7 @@ async def begin_start( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -2300,7 +2305,7 @@ async def _redeploy_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2455,7 +2460,7 @@ async def begin_redeploy( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -2514,7 +2519,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2675,7 +2680,7 @@ async def begin_perform_maintenance( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -2734,7 +2739,7 @@ async def _update_instances_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2883,7 +2888,7 @@ async def begin_update_instances( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -2942,7 +2947,7 @@ async def _reimage_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3098,7 +3103,7 @@ async def begin_reimage( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -3157,7 +3162,7 @@ async def _reimage_all_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3312,7 +3317,7 @@ async def begin_reimage_all( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -3383,7 +3388,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3513,7 +3518,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3573,7 +3578,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3721,7 +3726,7 @@ async def begin_set_orchestration_service_state( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_sizes_operations.py index 386bcba947fd..6114bcbd931a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py index 8995954e8e35..ce6a46c0b01e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1230,7 +1235,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1299,7 +1304,7 @@ async def generalize( # 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1345,7 +1350,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1430,7 +1435,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1518,7 +1523,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1601,7 +1606,7 @@ async def _power_off_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1662,7 +1667,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1715,7 +1720,7 @@ async def _reapply_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1768,7 +1773,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1820,7 +1825,7 @@ async def _restart_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1873,7 +1878,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1925,7 +1930,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1978,7 +1983,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2030,7 +2035,7 @@ async def _redeploy_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2083,7 +2088,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2139,7 +2144,7 @@ async def _reimage_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2289,7 +2294,7 @@ async def begin_reimage( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -2364,7 +2369,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2413,7 +2418,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2468,7 +2473,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2532,7 +2537,7 @@ async def simulate_eviction( # 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2576,7 +2581,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2639,7 +2644,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2699,7 +2704,7 @@ async def _install_patches_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.VirtualMachineInstallPatchesResult]] @@ -2860,7 +2865,7 @@ async def begin_install_patches( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2919,7 +2924,7 @@ async def _run_command_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.RunCommandResult]] @@ -3072,7 +3077,7 @@ async def begin_run_command( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py index 45e6dcef548f..847a0900c97b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -101,8 +106,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_availability_sets_operations.py index afd1dee6f9f2..c6f85d80e545 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservation_groups_operations.py index 8f68bae08f1a..456d209da57b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_by_subscription_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,7 +370,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -510,7 +515,7 @@ def 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -585,7 +590,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -715,7 +720,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -807,7 +812,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservations_operations.py index eb582ad4a70c..fac5c2043be9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -89,7 +94,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -130,7 +135,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_capacity_reservation_group_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -446,7 +451,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -509,7 +514,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.CapacityReservation]] @@ -676,7 +681,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -802,7 +807,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -879,7 +884,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -935,7 +940,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_host_groups_operations.py index 72939edd6ec3..115ee2760e23 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,7 +145,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +176,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +204,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -334,7 +339,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -474,7 +479,7 @@ def 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -546,7 +551,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -661,7 +666,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -742,7 +747,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_hosts_operations.py index a21fcdba4958..6e4c4c95802a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_group_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -881,7 +886,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_accesses_operations.py index e151bc355bf9..be2b884f9c7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # pylint: disable=inconsiste _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_encryption_sets_operations.py index 9d51a0ab67fd..27481f69d04b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_restore_point_operations.py index 2bee01640ff8..26cfd682727d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -313,7 +318,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -403,7 +408,7 @@ def _grant_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.AccessUri]] @@ -582,7 +587,7 @@ def begin_grant_access( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -648,7 +653,7 @@ def _revoke_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -716,7 +721,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disks_operations.py index 7e95ba3cc9b6..2a3f7f00f507 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_images_operations.py index 633d840f62da..0e2c297653de 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_log_analytics_operations.py index 04ed192d568b..1e34375f03ab 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_operations.py index 17b838a40d91..b0ec31c1705b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_proximity_placement_groups_operations.py index 50c50aeddd88..f7a2a4fb46ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ def 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_point_collections_operations.py index e55df533e1bd..665530055911 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -496,7 +501,7 @@ def 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -556,7 +561,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,7 +689,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -735,7 +740,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -819,7 +824,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_points_operations.py index a353aac2ad03..16a5a1f61114 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +130,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -356,7 +361,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -414,7 +419,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -472,7 +477,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_snapshots_operations.py index c86b59665256..65e85524320f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_ssh_public_keys_operations.py index b483755638b4..45d3ef7f4e96 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ def create( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ def 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_usage_operations.py index cb5025b2f719..a92bd35d45f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extension_images_operations.py index 8b533fbede35..4eb59e6c777e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extensions_operations.py index 45304548679d..4c4ad9ca9525 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_edge_zone_operations.py index 4fa8384f7f95..7e59bb24631e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: str, subscription_id _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_operations.py index 04a763af68e2..e91c79deb9b0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_run_commands_operations.py index 5cd9f8e5d624..b487c993260b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_extensions_operations.py index 2c0207047776..45ef5fb04663 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index eb330852641d..60109a46dfc5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 9c228c050bb9..7fa9c11b79cb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 6018faa8e90b..afdc5e0b3705 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,7 +176,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vms_operations.py index de8443c27b12..9b53ec53f008 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -168,7 +173,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -203,7 +208,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_get_instance_view_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -276,7 +281,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -348,7 +353,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -374,7 +379,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -400,7 +405,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -433,7 +438,7 @@ def build_retrieve_boot_diagnostics_data_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -468,7 +473,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -494,7 +499,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -521,7 +526,7 @@ def build_run_command_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -588,7 +593,7 @@ def _reimage_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -750,7 +755,7 @@ def begin_reimage( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -806,7 +811,7 @@ def _reimage_all_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -865,7 +870,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -918,7 +923,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -978,7 +983,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1210,7 +1215,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1273,7 +1278,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1340,7 +1345,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1417,7 +1422,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1481,7 +1486,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1552,7 +1557,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1643,7 +1648,7 @@ def _power_off_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1713,7 +1718,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1767,7 +1772,7 @@ def _restart_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1825,7 +1830,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1878,7 +1883,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1936,7 +1941,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1989,7 +1994,7 @@ def _redeploy_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2048,7 +2053,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2125,7 +2130,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2175,7 +2180,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2233,7 +2238,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2300,7 +2305,7 @@ def simulate_eviction( # 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2350,7 +2355,7 @@ def _run_command_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.RunCommandResult]] @@ -2514,7 +2519,7 @@ def begin_run_command( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_sets_operations.py index d1f8c134b6fe..fb2c3cfc4072 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -144,7 +149,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -177,7 +182,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -246,7 +251,7 @@ def build_delete_instances_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -279,7 +284,7 @@ def build_get_instance_view_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,7 +341,7 @@ def build_list_all_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -364,7 +369,7 @@ def build_list_skus_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +400,7 @@ def build_get_os_upgrade_history_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -431,7 +436,7 @@ def build_power_off_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -464,7 +469,7 @@ def build_restart_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -495,7 +500,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -526,7 +531,7 @@ def build_redeploy_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -557,7 +562,7 @@ def build_perform_maintenance_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -588,7 +593,7 @@ def build_update_instances_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -619,7 +624,7 @@ def build_reimage_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -650,7 +655,7 @@ def build_reimage_all_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -686,7 +691,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -718,7 +723,7 @@ def build_convert_to_single_placement_group_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -749,7 +754,7 @@ def build_set_orchestration_service_state_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -810,7 +815,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -896,7 +901,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1054,7 +1059,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1115,7 +1120,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1269,7 +1274,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1326,7 +1331,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1385,7 +1390,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1458,7 +1463,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1511,7 +1516,7 @@ def _deallocate_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1669,7 +1674,7 @@ def begin_deallocate( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -1729,7 +1734,7 @@ def _delete_instances_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1891,7 +1896,7 @@ def begin_delete_instances( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -1959,7 +1964,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2009,7 +2014,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2093,7 +2098,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2181,7 +2186,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2270,7 +2275,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2358,7 +2363,7 @@ def _power_off_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2532,7 +2537,7 @@ def begin_power_off( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -2592,7 +2597,7 @@ def _restart_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2744,7 +2749,7 @@ def begin_restart( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -2803,7 +2808,7 @@ def _start_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2955,7 +2960,7 @@ def begin_start( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -3014,7 +3019,7 @@ def _redeploy_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3169,7 +3174,7 @@ def begin_redeploy( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -3228,7 +3233,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3389,7 +3394,7 @@ def begin_perform_maintenance( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -3448,7 +3453,7 @@ def _update_instances_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3597,7 +3602,7 @@ def begin_update_instances( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -3656,7 +3661,7 @@ def _reimage_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3812,7 +3817,7 @@ def begin_reimage( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -3871,7 +3876,7 @@ def _reimage_all_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4026,7 +4031,7 @@ def begin_reimage_all( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -4097,7 +4102,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4227,7 +4232,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4287,7 +4292,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4435,7 +4440,7 @@ def begin_set_orchestration_service_state( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py index 08e5b7282b22..7911519bb4f3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machines_operations.py index 73dcd7811892..8c076f8300a6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -207,7 +212,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +245,7 @@ def build_instance_view_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,7 +275,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -295,7 +300,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -320,7 +325,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -344,7 +349,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +377,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[str] = _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -400,7 +405,7 @@ def build_list_available_sizes_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -430,7 +435,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -456,7 +461,7 @@ def build_reapply_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -484,7 +489,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -507,7 +512,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -530,7 +535,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -554,7 +559,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -590,7 +595,7 @@ def build_retrieve_boot_diagnostics_data_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -624,7 +629,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -649,7 +654,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -675,7 +680,7 @@ def build_assess_patches_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -706,7 +711,7 @@ def build_install_patches_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -740,7 +745,7 @@ def build_run_command_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -802,7 +807,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -888,7 +893,7 @@ def _capture_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.VirtualMachineCaptureResult]] @@ -1048,7 +1053,7 @@ def begin_capture( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1107,7 +1112,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1262,7 +1267,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1319,7 +1324,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1467,7 +1472,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1524,7 +1529,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1583,7 +1588,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1658,7 +1663,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1719,7 +1724,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1767,7 +1772,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1821,7 +1826,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1873,7 +1878,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1927,7 +1932,7 @@ def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1996,7 +2001,7 @@ def generalize( # 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2041,7 +2046,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2125,7 +2130,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2212,7 +2217,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2295,7 +2300,7 @@ def _power_off_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2356,7 +2361,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2409,7 +2414,7 @@ def _reapply_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2462,7 +2467,7 @@ def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2514,7 +2519,7 @@ def _restart_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2567,7 +2572,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2619,7 +2624,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2672,7 +2677,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2724,7 +2729,7 @@ def _redeploy_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2777,7 +2782,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2833,7 +2838,7 @@ def _reimage_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2983,7 +2988,7 @@ def begin_reimage( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] 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] @@ -3058,7 +3063,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3107,7 +3112,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3160,7 +3165,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3224,7 +3229,7 @@ def simulate_eviction( # 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3268,7 +3273,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3331,7 +3336,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3391,7 +3396,7 @@ def _install_patches_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.VirtualMachineInstallPatchesResult]] @@ -3552,7 +3557,7 @@ def begin_install_patches( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3611,7 +3616,7 @@ def _run_command_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-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.RunCommandResult]] @@ -3761,7 +3766,7 @@ def begin_run_command( _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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_configuration.py index 026062671e53..b3e219d6f4c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-07-01") # type: str + api_version = kwargs.pop("api_version", "2021-07-01") # type: Literal["2021-07-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json index 913dbd9606e2..47866080547a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json @@ -137,4 +137,4 @@ "community_gallery_images": "CommunityGalleryImagesOperations", "community_gallery_image_versions": "CommunityGalleryImageVersionsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_configuration.py index 8f9a199ff200..a8a7cbf95cfc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-07-01") # type: str + api_version = kwargs.pop("api_version", "2021-07-01") # type: Literal["2021-07-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_availability_sets_operations.py index f046a518cec1..150ecdd79619 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py index d31ca381a259..691997bee73f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -301,7 +306,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -376,7 +381,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -443,7 +448,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -506,7 +511,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -598,7 +603,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py index a73701ee9bc8..702bf27bb069 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -255,7 +260,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -318,7 +323,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -485,7 +490,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -744,7 +749,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py index 4953cb6161cc..b26a1be23998 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._community_galleries_operations import build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ async def get(self, location: str, public_gallery_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py index 7ddc21cabc7d..aeffad1620f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._community_gallery_image_versions_operations import build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py index 5c03da0eb0e4..fc0be6fc605b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._community_gallery_images_operations import build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py index f718bea6d4b7..8d85b3428517 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -433,7 +438,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_hosts_operations.py index 6b3ad0432361..557d5d3377cc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -725,7 +730,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_galleries_operations.py index b30605a3b627..a984c0c2ccdc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -526,7 +531,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -575,7 +580,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -628,7 +633,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -680,7 +685,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -760,7 +765,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py index 7c4dd9802688..1db23a742689 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py index 8fd7e8cf0751..b415ad23a2ed 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py index fb955e17c53b..dc6bba90d623 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_operations.py index a2649dfbdb5a..f7018cb1b395 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py index 24d8487574c5..2eaca32df37c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._gallery_sharing_profile_operations import build_update_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -229,7 +234,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py index 1572aab7b2f8..1f3c197c45bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_log_analytics_operations.py index 32053ba814be..353311094d03 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_operations.py index 2cf5450ea162..d3e730d0eb3f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_proximity_placement_groups_operations.py index 87aa81315dab..c08ee8178096 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_resource_skus_operations.py index 36eb3af3cd5b..01407de71ea0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._resource_skus_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +78,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py index 98c5a62d3fb2..c861f7b35bd7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -302,7 +307,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -362,7 +367,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -418,7 +423,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -490,7 +495,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -541,7 +546,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -625,7 +630,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py index 129b5e651030..f0680356df3e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_request, build_delete_request, build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -236,7 +241,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -294,7 +299,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -352,7 +357,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_operations.py index 875730800d21..17ce2aab5067 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_galleries_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +78,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -166,7 +171,7 @@ async def get(self, location: str, gallery_unique_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py index f0b5e4df639c..bab64467674f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_image_versions_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -194,7 +199,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py index 98693f25d923..4974b1b3405d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_images_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -178,7 +183,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_ssh_public_keys_operations.py index 0db2d2f7fcc8..9e22b7d57b36 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_usage_operations.py index 2dc1c930227c..d9a42cbaaea0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extension_images_operations.py index ed6c18dfb8a1..c57c10f26277 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py index f0925d58ff9c..cf8e739ae01b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index 34889416e642..87de68573228 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_operations.py index 504a05a880a6..e6ba8a226be1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py index afa60c6cc2ee..0426cb514e95 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 4e24b45d1dcc..39f531598138 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index b508fbb0884a..b6db85832e1a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index c484c78f8049..c03b10d1cba5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 3b1910772077..07ee6c8d3cb9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 14ccea28121d..43ad1d54bde5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1678,7 +1683,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1736,7 +1741,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def simulate_eviction( # 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1853,7 +1858,7 @@ async def _run_command_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2020,7 +2025,7 @@ async def begin_run_command( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py index 3cf44fc21cbb..5ec0114c2040 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -671,7 +676,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,7 +749,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -797,7 +802,7 @@ async def _deallocate_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -955,7 +960,7 @@ async def begin_deallocate( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -1015,7 +1020,7 @@ async def _delete_instances_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1177,7 +1182,7 @@ async def begin_delete_instances( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -1245,7 +1250,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1295,7 +1300,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1379,7 +1384,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1467,7 +1472,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1556,7 +1561,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1644,7 +1649,7 @@ async def _power_off_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1818,7 +1823,7 @@ async def begin_power_off( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -1878,7 +1883,7 @@ async def _restart_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2030,7 +2035,7 @@ async def begin_restart( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -2089,7 +2094,7 @@ async def _start_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2241,7 +2246,7 @@ async def begin_start( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -2300,7 +2305,7 @@ async def _redeploy_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2455,7 +2460,7 @@ async def begin_redeploy( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -2514,7 +2519,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2675,7 +2680,7 @@ async def begin_perform_maintenance( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -2734,7 +2739,7 @@ async def _update_instances_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2883,7 +2888,7 @@ async def begin_update_instances( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -2942,7 +2947,7 @@ async def _reimage_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3098,7 +3103,7 @@ async def begin_reimage( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -3157,7 +3162,7 @@ async def _reimage_all_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3312,7 +3317,7 @@ async def begin_reimage_all( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -3383,7 +3388,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3513,7 +3518,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3573,7 +3578,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3721,7 +3726,7 @@ async def begin_set_orchestration_service_state( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_sizes_operations.py index beb0b7dfdf42..67891b207cc3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machines_operations.py index 5d4c261901fd..655c96f5fa86 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1236,7 +1241,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1306,7 +1311,7 @@ async def generalize( # 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1352,7 +1357,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1437,7 +1442,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1525,7 +1530,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1608,7 +1613,7 @@ async def _power_off_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1669,7 +1674,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1722,7 +1727,7 @@ async def _reapply_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1775,7 +1780,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1827,7 +1832,7 @@ async def _restart_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1880,7 +1885,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1932,7 +1937,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1985,7 +1990,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2037,7 +2042,7 @@ async def _redeploy_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2090,7 +2095,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2146,7 +2151,7 @@ async def _reimage_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2296,7 +2301,7 @@ async def begin_reimage( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -2371,7 +2376,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2420,7 +2425,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2475,7 +2480,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2539,7 +2544,7 @@ async def simulate_eviction( # 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2583,7 +2588,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2646,7 +2651,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2706,7 +2711,7 @@ async def _install_patches_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2867,7 +2872,7 @@ async def begin_install_patches( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2926,7 +2931,7 @@ async def _run_command_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3079,7 +3084,7 @@ async def begin_run_command( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py index c3550e97cde5..058f56ef52a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -87,8 +92,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_availability_sets_operations.py index 800f967a0cd2..bfd776e1273a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_by_subscription_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ def 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservation_groups_operations.py index ad3c84bf045f..94d76baa038c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_by_subscription_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,7 +370,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -510,7 +515,7 @@ def 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -585,7 +590,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -715,7 +720,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -807,7 +812,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py index cf6f4d4193de..8bc054f8fa98 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -89,7 +94,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -130,7 +135,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_capacity_reservation_group_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -446,7 +451,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -509,7 +514,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -676,7 +681,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -802,7 +807,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -879,7 +884,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -935,7 +940,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py index 6dd4a04e0e0b..a68f6c33ea1d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -38,7 +43,7 @@ def build_get_request(location: str, public_gallery_name: str, subscription_id: _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +111,7 @@ def get(self, location: str, public_gallery_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py index b67b65cb91ca..39101e355766 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +50,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +134,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py index a05c67585c95..cd83dd8065e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +118,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py index d25601bc6984..d819f5d2918a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,7 +145,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +176,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +204,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -334,7 +339,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -474,7 +479,7 @@ def 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -546,7 +551,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -661,7 +666,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -742,7 +747,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_hosts_operations.py index 367d6b31ba4a..69f46b426941 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_group_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -881,7 +886,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_galleries_operations.py index f0f1ecd4a2eb..8d92f9b28a52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -117,7 +122,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +265,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -420,7 +425,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -477,7 +482,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -628,7 +633,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -704,7 +709,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -753,7 +758,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -806,7 +811,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -858,7 +863,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -938,7 +943,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py index 9e7fae25c4c9..112678636727 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py index dd75d28a8e4e..4b7fdbc293a3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py index 2442c467b810..ef1121435bb8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py index fb08c7d52675..1bbeba7c28f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py index 3a5c692e29de..456b4d632092 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -263,7 +268,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py index 92932e69a724..915414b63e7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_log_analytics_operations.py index f5a34b2bc736..6fcc067a6344 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_operations.py index e6bd8ca60767..15dd6b347ae4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_proximity_placement_groups_operations.py index 8923ba6637be..c383d6890ad1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ def 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_resource_skus_operations.py index 968f1f1cc091..c20cb6a48ca6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py index d6419368bbbb..c4e24ef257c3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -496,7 +501,7 @@ def 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -556,7 +561,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,7 +689,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -735,7 +740,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -819,7 +824,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py index e676abce8c6f..30118f75b6ce 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +130,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -356,7 +361,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -414,7 +419,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -472,7 +477,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py index caefbdfdebbc..91cd1a81a150 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_get_request(location: str, gallery_unique_name: str, subscription_id: _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -232,7 +237,7 @@ def get(self, location: str, gallery_unique_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py index 5313dc91a0aa..a4f291115c16 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -274,7 +279,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py index 28d5373c0d3c..86bce36ef406 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -249,7 +254,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_ssh_public_keys_operations.py index 705c8155619b..aa851d824193 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ def create( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ def 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_usage_operations.py index 9b79a77b87f2..ade11d81b2ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extension_images_operations.py index 8dbbf8dea7ec..5084b71dca87 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extensions_operations.py index 545d16b553b8..d6881a2d0f5f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py index d370f36a5e6b..1deb4f6cf29c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: str, subscription_id _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py index c5d5c006f1f1..6f5382dab0e7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_run_commands_operations.py index 6dca314a4e2e..63c13b075125 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py index 7559b09932ed..6c3ba9386276 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 032703df81df..cdab0fc73a60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index f47d7484d873..f4dfde17b25b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 8a9d33972bd2..d8db1e95676c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,7 +176,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py index 62198ffa81a4..117f0b14b57e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -168,7 +173,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -203,7 +208,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_get_instance_view_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -276,7 +281,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -348,7 +353,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -374,7 +379,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -400,7 +405,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -433,7 +438,7 @@ def build_retrieve_boot_diagnostics_data_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -468,7 +473,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -494,7 +499,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -521,7 +526,7 @@ def build_run_command_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -588,7 +593,7 @@ def _reimage_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -750,7 +755,7 @@ def begin_reimage( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -806,7 +811,7 @@ def _reimage_all_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -865,7 +870,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -918,7 +923,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -978,7 +983,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1210,7 +1215,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1273,7 +1278,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1340,7 +1345,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1417,7 +1422,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1481,7 +1486,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1552,7 +1557,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1643,7 +1648,7 @@ def _power_off_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1713,7 +1718,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1767,7 +1772,7 @@ def _restart_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1825,7 +1830,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1878,7 +1883,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1936,7 +1941,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1989,7 +1994,7 @@ def _redeploy_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2048,7 +2053,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2125,7 +2130,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2175,7 +2180,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2233,7 +2238,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2300,7 +2305,7 @@ def simulate_eviction( # 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2350,7 +2355,7 @@ def _run_command_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2514,7 +2519,7 @@ def begin_run_command( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py index 293a51a18d8f..2686e55a32d1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -144,7 +149,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -177,7 +182,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -246,7 +251,7 @@ def build_delete_instances_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -279,7 +284,7 @@ def build_get_instance_view_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,7 +341,7 @@ def build_list_all_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -364,7 +369,7 @@ def build_list_skus_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +400,7 @@ def build_get_os_upgrade_history_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -431,7 +436,7 @@ def build_power_off_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -464,7 +469,7 @@ def build_restart_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -495,7 +500,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -526,7 +531,7 @@ def build_redeploy_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -557,7 +562,7 @@ def build_perform_maintenance_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -588,7 +593,7 @@ def build_update_instances_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -619,7 +624,7 @@ def build_reimage_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -650,7 +655,7 @@ def build_reimage_all_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -686,7 +691,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -718,7 +723,7 @@ def build_convert_to_single_placement_group_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -749,7 +754,7 @@ def build_set_orchestration_service_state_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -810,7 +815,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -896,7 +901,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1054,7 +1059,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1115,7 +1120,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1269,7 +1274,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1326,7 +1331,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1385,7 +1390,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1458,7 +1463,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1511,7 +1516,7 @@ def _deallocate_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1669,7 +1674,7 @@ def begin_deallocate( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -1729,7 +1734,7 @@ def _delete_instances_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1891,7 +1896,7 @@ def begin_delete_instances( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -1959,7 +1964,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2009,7 +2014,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2093,7 +2098,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2181,7 +2186,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2270,7 +2275,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2358,7 +2363,7 @@ def _power_off_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2532,7 +2537,7 @@ def begin_power_off( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -2592,7 +2597,7 @@ def _restart_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2744,7 +2749,7 @@ def begin_restart( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -2803,7 +2808,7 @@ def _start_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2955,7 +2960,7 @@ def begin_start( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -3014,7 +3019,7 @@ def _redeploy_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3169,7 +3174,7 @@ def begin_redeploy( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -3228,7 +3233,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3389,7 +3394,7 @@ def begin_perform_maintenance( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -3448,7 +3453,7 @@ def _update_instances_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3597,7 +3602,7 @@ def begin_update_instances( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -3656,7 +3661,7 @@ def _reimage_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3812,7 +3817,7 @@ def begin_reimage( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -3871,7 +3876,7 @@ def _reimage_all_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4026,7 +4031,7 @@ def begin_reimage_all( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -4097,7 +4102,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4227,7 +4232,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4287,7 +4292,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4435,7 +4440,7 @@ def begin_set_orchestration_service_state( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_sizes_operations.py index 75ecbf66f81f..3db59a57f325 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machines_operations.py index 62d993f07880..61a98ea9785d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -207,7 +212,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +245,7 @@ def build_instance_view_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,7 +275,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -295,7 +300,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -322,7 +327,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -346,7 +351,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[str] = _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -402,7 +407,7 @@ def build_list_available_sizes_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -458,7 +463,7 @@ def build_reapply_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -486,7 +491,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -509,7 +514,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -532,7 +537,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -556,7 +561,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -592,7 +597,7 @@ def build_retrieve_boot_diagnostics_data_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -626,7 +631,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -651,7 +656,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -677,7 +682,7 @@ def build_assess_patches_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -708,7 +713,7 @@ def build_install_patches_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -742,7 +747,7 @@ def build_run_command_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -804,7 +809,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -890,7 +895,7 @@ def _capture_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1050,7 +1055,7 @@ def begin_capture( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1109,7 +1114,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1264,7 +1269,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1321,7 +1326,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1469,7 +1474,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1526,7 +1531,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1585,7 +1590,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1660,7 +1665,7 @@ 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1721,7 +1726,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1769,7 +1774,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1823,7 +1828,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1875,7 +1880,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1935,7 +1940,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2005,7 +2010,7 @@ def generalize( # 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2050,7 +2055,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2134,7 +2139,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2221,7 +2226,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2304,7 +2309,7 @@ def _power_off_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2365,7 +2370,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2418,7 +2423,7 @@ def _reapply_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2471,7 +2476,7 @@ def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2523,7 +2528,7 @@ def _restart_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2576,7 +2581,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2628,7 +2633,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2681,7 +2686,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2733,7 +2738,7 @@ def _redeploy_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2786,7 +2791,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2842,7 +2847,7 @@ def _reimage_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2992,7 +2997,7 @@ def begin_reimage( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] 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] @@ -3067,7 +3072,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3116,7 +3121,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3169,7 +3174,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3233,7 +3238,7 @@ def simulate_eviction( # 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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3277,7 +3282,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3340,7 +3345,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3400,7 +3405,7 @@ def _install_patches_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3561,7 +3566,7 @@ def begin_install_patches( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3620,7 +3625,7 @@ def _run_command_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3770,7 +3775,7 @@ def begin_run_command( _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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_configuration.py index b6372c22bee1..8f4d7d9bc5a0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-08-01") # type: str + api_version = kwargs.pop("api_version", "2021-08-01") # type: Literal["2021-08-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_metadata.json index b2bce3a417cf..db027e8b00e3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_metadata.json @@ -103,4 +103,4 @@ "disk_accesses": "DiskAccessesOperations", "disk_restore_point": "DiskRestorePointOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/_configuration.py index 34637dcbb635..3fdfc24b483e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-08-01") # type: str + api_version = kwargs.pop("api_version", "2021-08-01") # type: Literal["2021-08-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_accesses_operations.py index 36390b27ee5c..732ff3dd04b4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] 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] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # pylint: disable=inco _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_encryption_sets_operations.py index a2de542f9281..94365defb2f1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_restore_point_operations.py index 7dd4d2ef7a96..3f9cd33ce005 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -156,7 +161,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -246,7 +251,7 @@ async def _grant_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -428,7 +433,7 @@ async def begin_grant_access( _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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -494,7 +499,7 @@ async def _revoke_access_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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -562,7 +567,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disks_operations.py index aa97c77bd0ec..a3ab186d4f49 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_snapshots_operations.py index 49272f293aad..f146664fc16f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_accesses_operations.py index fb8bda04044c..2e4331c54193 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] 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] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # pylint: disable=inconsiste _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_encryption_sets_operations.py index 711b2ed6439c..b250e7be237c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_restore_point_operations.py index d28702c6e7d8..19492c8626fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -313,7 +318,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -403,7 +408,7 @@ def _grant_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -582,7 +587,7 @@ def begin_grant_access( _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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -648,7 +653,7 @@ def _revoke_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -716,7 +721,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disks_operations.py index 7d88626fc82a..aa616384ba55 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_snapshots_operations.py index 66ec55fbec26..eea368c0b4ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_configuration.py index d8201b1a83a1..c8b02622b7bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-10-01") # type: str + api_version = kwargs.pop("api_version", "2021-10-01") # type: Literal["2021-10-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_metadata.json index d627f853a63b..04cf4fc4fb7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_metadata.json @@ -104,4 +104,4 @@ "gallery_application_versions": "GalleryApplicationVersionsOperations", "gallery_sharing_profile": "GallerySharingProfileOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/_configuration.py index 8300d3630db6..7930729a4104 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-10-01") # type: str + api_version = kwargs.pop("api_version", "2021-10-01") # type: Literal["2021-10-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_galleries_operations.py index 7b7a8a2d9b5f..ded852135d05 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -530,7 +535,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -580,7 +585,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -633,7 +638,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -685,7 +690,7 @@ 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", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -765,7 +770,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_application_versions_operations.py index dbcb0e4b08a5..ea059239b711 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_applications_operations.py index 41553330a68f..deada00879f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_image_versions_operations.py index b5bbee1c0f50..742aa163ab23 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_images_operations.py index 5c6576b97a6b..c5273367258a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_sharing_profile_operations.py index 2de672b0cf8f..f74daa2e992a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._gallery_sharing_profile_operations import build_update_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -229,7 +234,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_galleries_operations.py index 2752dab5803f..2756f9c8ff7a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -118,7 +123,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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +158,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +187,7 @@ 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", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ 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", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -263,7 +268,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -423,7 +428,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -480,7 +485,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -631,7 +636,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -761,7 +766,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -814,7 +819,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -866,7 +871,7 @@ 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", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -946,7 +951,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_application_versions_operations.py index b60ec2a52611..214d7f47c6db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_applications_operations.py index cb1e64b06e8d..8649b7f4241b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_image_versions_operations.py index 66cd3d97eaab..6353405d650c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_images_operations.py index 8ffa5a0d0aed..44f7c7faa109 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_sharing_profile_operations.py index 02b0058b669b..e5cea328ed29 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -263,7 +268,7 @@ 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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_configuration.py index 1de487494ebd..db079a8f6b1c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-11-01") # type: str + api_version = kwargs.pop("api_version", "2021-11-01") # type: Literal["2021-11-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_metadata.json index c03a1dbeec1d..93b154eb5b68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_metadata.json @@ -124,4 +124,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/_configuration.py index d67baf8fcac5..1aa6df0280c0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-11-01") # type: str + api_version = kwargs.pop("api_version", "2021-11-01") # type: Literal["2021-11-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_availability_sets_operations.py index 54afd6f0170d..fb2a15ed4c3f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservation_groups_operations.py index 4c33e1a58c23..856eba2b1613 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -301,7 +306,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -376,7 +381,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -443,7 +448,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -506,7 +511,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -598,7 +603,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservations_operations.py index f20725c82360..6ee3dbc82d5e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -255,7 +260,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -318,7 +323,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -485,7 +490,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -744,7 +749,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_host_groups_operations.py index 47a19bba1e98..be226d4c87fa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -433,7 +438,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_hosts_operations.py index 34a8f472df41..e91a74eed2b5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -250,7 +255,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -478,7 +483,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -536,7 +541,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -594,7 +599,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -670,7 +675,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -726,7 +731,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { @@ -809,7 +814,7 @@ async def _restart_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -870,7 +875,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_images_operations.py index 2f4cc2d5c61e..9a3db4f01f22 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_log_analytics_operations.py index 458d2e8ef3a5..67aa19f13181 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_operations.py index 90518b854edf..1622cf80e26c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_proximity_placement_groups_operations.py index 941a8f641c0b..ee6feb9301b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_point_collections_operations.py index a005776b30b3..f0621b9e62ba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -302,7 +307,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -362,7 +367,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -418,7 +423,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -490,7 +495,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -541,7 +546,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -625,7 +630,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_points_operations.py index 5859c82b9a09..15848b4f56e9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_request, build_delete_request, build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -236,7 +241,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -294,7 +299,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -352,7 +357,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -427,7 +432,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_ssh_public_keys_operations.py index cc071bfa7710..efc49e5be280 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_usage_operations.py index 00f343c8b4bf..a293ef42b5cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extension_images_operations.py index 090e9f2a3f01..c069753cb886 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extensions_operations.py index 483ac078ae4b..6353be418552 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index fbdef249cc97..641642d5a634 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_operations.py index df69da6d8cbb..445ad1624504 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_run_commands_operations.py index 961270409e89..0eb2352d7d9e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 72b49fad181d..099c80639f7c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 57d50c2b7ce8..aa6b43b7f1eb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 44e1b9eec1f7..d95017069aad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index d4f00c0489e6..713a9f32d7fc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 7f6d4963a194..b6acba2cad82 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1678,7 +1683,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1736,7 +1741,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def simulate_eviction( # 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1853,7 +1858,7 @@ async def _run_command_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2020,7 +2025,7 @@ async def begin_run_command( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_sets_operations.py index ba3952019e6d..3d7f67971cf9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -671,7 +676,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,7 +749,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -797,7 +802,7 @@ async def _deallocate_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -955,7 +960,7 @@ async def begin_deallocate( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -1015,7 +1020,7 @@ async def _delete_instances_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1177,7 +1182,7 @@ async def begin_delete_instances( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -1245,7 +1250,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1295,7 +1300,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1379,7 +1384,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1467,7 +1472,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1556,7 +1561,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1644,7 +1649,7 @@ async def _power_off_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1818,7 +1823,7 @@ async def begin_power_off( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -1878,7 +1883,7 @@ async def _restart_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2030,7 +2035,7 @@ async def begin_restart( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -2089,7 +2094,7 @@ async def _start_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2241,7 +2246,7 @@ async def begin_start( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -2300,7 +2305,7 @@ async def _redeploy_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2455,7 +2460,7 @@ async def begin_redeploy( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -2514,7 +2519,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2675,7 +2680,7 @@ async def begin_perform_maintenance( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -2734,7 +2739,7 @@ async def _update_instances_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2883,7 +2888,7 @@ async def begin_update_instances( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -2942,7 +2947,7 @@ async def _reimage_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3098,7 +3103,7 @@ async def begin_reimage( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -3157,7 +3162,7 @@ async def _reimage_all_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3312,7 +3317,7 @@ async def begin_reimage_all( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -3395,7 +3400,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3527,7 +3532,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3587,7 +3592,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3735,7 +3740,7 @@ async def begin_set_orchestration_service_state( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_sizes_operations.py index bc277c89c9fc..a9394bd869bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machines_operations.py index 9dd96310dddb..0f0150ed6ae0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1236,7 +1241,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1306,7 +1311,7 @@ async def generalize( # 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1359,7 +1364,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1452,7 +1457,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1541,7 +1546,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1624,7 +1629,7 @@ async def _power_off_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1685,7 +1690,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1738,7 +1743,7 @@ async def _reapply_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1791,7 +1796,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1843,7 +1848,7 @@ async def _restart_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1896,7 +1901,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1948,7 +1953,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2001,7 +2006,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2053,7 +2058,7 @@ async def _redeploy_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2106,7 +2111,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2162,7 +2167,7 @@ async def _reimage_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2312,7 +2317,7 @@ async def begin_reimage( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -2387,7 +2392,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2436,7 +2441,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2491,7 +2496,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2555,7 +2560,7 @@ async def simulate_eviction( # 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2599,7 +2604,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2662,7 +2667,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2722,7 +2727,7 @@ async def _install_patches_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2883,7 +2888,7 @@ async def begin_install_patches( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2942,7 +2947,7 @@ async def _run_command_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3095,7 +3100,7 @@ async def begin_run_command( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/models/_models_py3.py index a57513ee0847..cb86c7cd54ef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -87,8 +92,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_availability_sets_operations.py index 02f457354b12..ad283f5544e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_list_by_subscription_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -228,7 +233,7 @@ def build_list_available_sizes_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -362,7 +367,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -498,7 +503,7 @@ def 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -570,7 +575,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -673,7 +678,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -755,7 +760,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -842,7 +847,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservation_groups_operations.py index 54f0f7bd8134..35d116f277b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_by_subscription_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,7 +370,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -510,7 +515,7 @@ def 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -585,7 +590,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -715,7 +720,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -807,7 +812,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservations_operations.py index 47916de9ca84..a83eec56e2bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -89,7 +94,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -130,7 +135,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_capacity_reservation_group_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -446,7 +451,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -509,7 +514,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -676,7 +681,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -802,7 +807,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -879,7 +884,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -935,7 +940,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_host_groups_operations.py index ac85ceb72036..85283298134d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +182,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +210,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -480,7 +485,7 @@ def 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -552,7 +557,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -667,7 +672,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -748,7 +753,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py index 5c46bf094dcf..1e366a41d0f3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_list_by_host_group_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +222,7 @@ def build_restart_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +286,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -447,7 +452,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -510,7 +515,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -672,7 +677,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -730,7 +735,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -788,7 +793,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -864,7 +869,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -919,7 +924,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { @@ -1002,7 +1007,7 @@ def _restart_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1063,7 +1068,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_images_operations.py index 3297f9b64393..82247651f91a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_delete_request(resource_group_name: str, image_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -400,7 +405,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -457,7 +462,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -606,7 +611,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -663,7 +668,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -716,7 +721,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -782,7 +787,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -831,7 +836,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -912,7 +917,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_log_analytics_operations.py index b45f1c9e025b..c6b04679e877 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_operations.py index 05f840128639..73cf9bbbf7ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_proximity_placement_groups_operations.py index 79844f65607d..1a146286b355 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -490,7 +495,7 @@ def 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -562,7 +567,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -674,7 +679,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -759,7 +764,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_point_collections_operations.py index 7431fdd4b37c..ca017d39f3d7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -496,7 +501,7 @@ def 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -556,7 +561,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,7 +689,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -735,7 +740,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -819,7 +824,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_points_operations.py index ef2e836ead8e..bf88089f7fba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +200,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -360,7 +365,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -418,7 +423,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -476,7 +481,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -551,7 +556,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_ssh_public_keys_operations.py index 0458f64da26a..8b636b0626ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,7 @@ def build_generate_key_pair_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -283,7 +288,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -369,7 +374,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -527,7 +532,7 @@ def create( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -667,7 +672,7 @@ def 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -739,7 +744,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -793,7 +798,7 @@ def get(self, resource_group_name: str, ssh_public_key_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -855,7 +860,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_usage_operations.py index 5dd44b4d63c8..3ff4daaf2d76 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extension_images_operations.py index c1d9347411e1..f5a65f0e1c16 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extensions_operations.py index 979b09f1078e..4dc3cf6efd09 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +189,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -424,7 +429,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -659,7 +664,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -717,7 +722,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -776,7 +781,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -850,7 +855,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -914,7 +919,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_edge_zone_operations.py index b5d6b60f3514..c7b38da6d764 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: str, subscription_id _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_operations.py index 0ed91489df97..17c32378a259 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_run_commands_operations.py index 62c880dcb10d..8d106438cc50 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_extensions_operations.py index 678ed564fcac..cc06353ffe65 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -425,7 +430,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -488,7 +493,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -664,7 +669,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -722,7 +727,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -781,7 +786,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -855,7 +860,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -911,7 +916,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 826d967a8e5c..157a6f7c5a9d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_cancel_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_start_os_upgrade_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,7 @@ def build_start_extension_upgrade_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +140,7 @@ def build_get_latest_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def _cancel_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -246,7 +251,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -298,7 +303,7 @@ def _start_os_upgrade_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -355,7 +360,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -407,7 +412,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -464,7 +469,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +533,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 0f754ce15f82..df25cb6b68a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 3251ba39381f..518137181307 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,7 +176,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vms_operations.py index b57f22a265b2..2e79e70d36af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_reimage_all_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -184,7 +189,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +263,7 @@ def build_get_instance_view_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +302,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ def build_power_off_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_restart_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +413,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -440,7 +445,7 @@ def build_redeploy_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -478,7 +483,7 @@ def build_retrieve_boot_diagnostics_data_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -514,7 +519,7 @@ def build_perform_maintenance_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +551,7 @@ def build_simulate_eviction_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -578,7 +583,7 @@ def build_run_command_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -645,7 +650,7 @@ def _reimage_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -807,7 +812,7 @@ def begin_reimage( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -863,7 +868,7 @@ def _reimage_all_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -922,7 +927,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -975,7 +980,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1035,7 +1040,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1093,7 +1098,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1267,7 +1272,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1330,7 +1335,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1397,7 +1402,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1479,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1538,7 +1543,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1609,7 +1614,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1700,7 +1705,7 @@ def _power_off_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1770,7 +1775,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1824,7 +1829,7 @@ def _restart_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1882,7 +1887,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1935,7 +1940,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1993,7 +1998,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2046,7 +2051,7 @@ def _redeploy_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2105,7 +2110,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2182,7 +2187,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2232,7 +2237,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2290,7 +2295,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2357,7 +2362,7 @@ def simulate_eviction( # 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2407,7 +2412,7 @@ def _run_command_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2571,7 +2576,7 @@ def begin_run_command( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_sets_operations.py index d8e5d987ae8b..ae769c65246f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -145,7 +150,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +188,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -255,7 +260,7 @@ def build_delete_instances_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -291,7 +296,7 @@ def build_get_instance_view_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ def build_list_all_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_list_skus_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -407,7 +412,7 @@ def build_get_os_upgrade_history_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -443,7 +448,7 @@ def build_power_off_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -479,7 +484,7 @@ def build_restart_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -513,7 +518,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -547,7 +552,7 @@ def build_redeploy_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -581,7 +586,7 @@ def build_perform_maintenance_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -615,7 +620,7 @@ def build_update_instances_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -649,7 +654,7 @@ def build_reimage_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -683,7 +688,7 @@ def build_reimage_all_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -724,7 +729,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -760,7 +765,7 @@ def build_convert_to_single_placement_group_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -794,7 +799,7 @@ def build_set_orchestration_service_state_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -858,7 +863,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -944,7 +949,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1102,7 +1107,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1163,7 +1168,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1317,7 +1322,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1374,7 +1379,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1433,7 +1438,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1506,7 +1511,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1559,7 +1564,7 @@ def _deallocate_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1717,7 +1722,7 @@ def begin_deallocate( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -1777,7 +1782,7 @@ def _delete_instances_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1939,7 +1944,7 @@ def begin_delete_instances( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -2007,7 +2012,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2057,7 +2062,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2141,7 +2146,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2229,7 +2234,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2318,7 +2323,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2406,7 +2411,7 @@ def _power_off_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2580,7 +2585,7 @@ def begin_power_off( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -2640,7 +2645,7 @@ def _restart_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2792,7 +2797,7 @@ def begin_restart( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -2851,7 +2856,7 @@ def _start_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3003,7 +3008,7 @@ def begin_start( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -3062,7 +3067,7 @@ def _redeploy_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3217,7 +3222,7 @@ def begin_redeploy( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -3276,7 +3281,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3437,7 +3442,7 @@ def begin_perform_maintenance( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -3496,7 +3501,7 @@ def _update_instances_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3645,7 +3650,7 @@ def begin_update_instances( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -3704,7 +3709,7 @@ def _reimage_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3860,7 +3865,7 @@ def begin_reimage( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -3919,7 +3924,7 @@ def _reimage_all_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4074,7 +4079,7 @@ def begin_reimage_all( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -4157,7 +4162,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4289,7 +4294,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4349,7 +4354,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4497,7 +4502,7 @@ def begin_set_orchestration_service_state( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_sizes_operations.py index d2f7afafadd0..d039fee8cc87 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machines_operations.py index a9785006338a..be11d2c0be6c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -175,7 +180,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +251,7 @@ def build_instance_view_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def build_convert_to_managed_disks_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -341,7 +346,7 @@ def build_generalize_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +377,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -404,7 +409,7 @@ def build_list_all_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -434,7 +439,7 @@ def build_list_available_sizes_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -465,7 +470,7 @@ def build_power_off_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -496,7 +501,7 @@ def build_reapply_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -525,7 +530,7 @@ def build_restart_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -554,7 +559,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -583,7 +588,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -612,7 +617,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -651,7 +656,7 @@ def build_retrieve_boot_diagnostics_data_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -686,7 +691,7 @@ def build_perform_maintenance_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -717,7 +722,7 @@ def build_simulate_eviction_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -748,7 +753,7 @@ def build_assess_patches_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -779,7 +784,7 @@ def build_install_patches_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -813,7 +818,7 @@ def build_run_command_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -875,7 +880,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -961,7 +966,7 @@ def _capture_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1121,7 +1126,7 @@ def begin_capture( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1180,7 +1185,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1335,7 +1340,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1392,7 +1397,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1540,7 +1545,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1597,7 +1602,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1656,7 +1661,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1731,7 +1736,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1792,7 +1797,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1840,7 +1845,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1894,7 +1899,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1946,7 +1951,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -2006,7 +2011,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2076,7 +2081,7 @@ def generalize( # 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2128,7 +2133,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2220,7 +2225,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2308,7 +2313,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2391,7 +2396,7 @@ def _power_off_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2452,7 +2457,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2505,7 +2510,7 @@ def _reapply_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2558,7 +2563,7 @@ def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2610,7 +2615,7 @@ def _restart_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2663,7 +2668,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2715,7 +2720,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2768,7 +2773,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2820,7 +2825,7 @@ def _redeploy_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2873,7 +2878,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2929,7 +2934,7 @@ def _reimage_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3079,7 +3084,7 @@ def begin_reimage( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] 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] @@ -3154,7 +3159,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3203,7 +3208,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3256,7 +3261,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3320,7 +3325,7 @@ def simulate_eviction( # 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3364,7 +3369,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3427,7 +3432,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3487,7 +3492,7 @@ def _install_patches_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3648,7 +3653,7 @@ def begin_install_patches( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3707,7 +3712,7 @@ def _run_command_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3857,7 +3862,7 @@ def begin_run_command( _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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_configuration.py index acc15eb3a5bb..8adf53c04044 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-12-01") # type: str + api_version = kwargs.pop("api_version", "2021-12-01") # type: Literal["2021-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_metadata.json index 9d19d80c5fc9..018a4db8cb54 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_metadata.json @@ -103,4 +103,4 @@ "disk_accesses": "DiskAccessesOperations", "disk_restore_point": "DiskRestorePointOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/_configuration.py index 8cc0e896a8cf..1f78543b7e4c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-12-01") # type: str + api_version = kwargs.pop("api_version", "2021-12-01") # type: Literal["2021-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_accesses_operations.py index 6da73c2a4bca..d430b6f2dbd6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] 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] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # pylint: disable=inco _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_encryption_sets_operations.py index 00cdbef2ed96..9a74ebdb4601 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_restore_point_operations.py index 70b4cd323e96..cb3312256880 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -156,7 +161,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -246,7 +251,7 @@ async def _grant_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -428,7 +433,7 @@ async def begin_grant_access( _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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -494,7 +499,7 @@ async def _revoke_access_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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -562,7 +567,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disks_operations.py index fefd16017870..6686ba57d4a9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_snapshots_operations.py index 130bd74b87e8..1be9bf3755f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_accesses_operations.py index 36680532c547..44c202e3b37f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] 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] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # pylint: disable=inconsiste _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_encryption_sets_operations.py index b30074372fe6..3f9ef6051490 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_restore_point_operations.py index f9ce2559bd0c..82848a38c9f5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -313,7 +318,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -403,7 +408,7 @@ def _grant_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -582,7 +587,7 @@ def begin_grant_access( _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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -648,7 +653,7 @@ def _revoke_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -716,7 +721,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disks_operations.py index 0e03738e4e7f..846d765c95b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_snapshots_operations.py index a87ed7d307f8..cf7f56249a30 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_configuration.py index 4ff45bd7d094..f135ec38952c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-01-03") # type: str + api_version = kwargs.pop("api_version", "2022-01-03") # type: Literal["2022-01-03"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_metadata.json index 0fe9a29e8973..48c3456eb96e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_metadata.json @@ -110,4 +110,4 @@ "community_gallery_images": "CommunityGalleryImagesOperations", "community_gallery_image_versions": "CommunityGalleryImageVersionsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/_configuration.py index 4757a520f1e4..746a8687a0ed 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-01-03") # type: str + api_version = kwargs.pop("api_version", "2022-01-03") # type: Literal["2022-01-03"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_galleries_operations.py index 5307d83bed40..a40d0b45535e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._community_galleries_operations import build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ async def get(self, location: str, public_gallery_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_image_versions_operations.py index 94129af96980..fdc70560f849 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._community_gallery_image_versions_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersion] request = build_get_request( @@ -149,7 +154,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_images_operations.py index 879037203e5e..346428f0db6c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._community_gallery_images_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImage] request = build_get_request( @@ -136,7 +141,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_galleries_operations.py index 8e2b018a3a6f..dd1a017a3105 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -530,7 +535,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -580,7 +585,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -633,7 +638,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -685,7 +690,7 @@ 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", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -765,7 +770,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_application_versions_operations.py index b71b1e3c764c..8ee49c85933d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_applications_operations.py index c3010be4e5e2..fa07cbc65ffd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_image_versions_operations.py index 5da23dac9c26..615a8979c071 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_images_operations.py index d9c5f6b7dba2..657dfb7142c4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_sharing_profile_operations.py index 7f36d963a7cb..ffd3369fae87 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._gallery_sharing_profile_operations import build_update_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -229,7 +234,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_galleries_operations.py index b0d48fc9db36..b277e87e0325 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_galleries_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +78,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -166,7 +171,7 @@ async def get(self, location: str, gallery_unique_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_image_versions_operations.py index dc7d2868e640..a929f7b67d99 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_image_versions_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -194,7 +199,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_images_operations.py index 5b658dc5028f..2106e1eb21f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_images_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -178,7 +183,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_galleries_operations.py index 46340ca885f7..6f501e98616e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -38,7 +43,7 @@ def build_get_request(location: str, public_gallery_name: str, subscription_id: _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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +111,7 @@ def get(self, location: str, public_gallery_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_image_versions_operations.py index 2fba9c799031..58eaedb9c3a7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +168,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersion] request = build_get_request( @@ -221,7 +226,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_images_operations.py index cfa82d1b8949..766c41801152 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ def build_list_request(location: str, public_gallery_name: str, subscription_id: _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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -144,7 +149,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImage] request = build_get_request( @@ -197,7 +202,7 @@ def list(self, location: str, public_gallery_name: str, **kwargs: Any) -> Iterab _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_galleries_operations.py index a1cbd52fcf35..0808c83dd036 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -118,7 +123,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +158,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +187,7 @@ 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", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ 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", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -263,7 +268,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -423,7 +428,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -480,7 +485,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -631,7 +636,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -761,7 +766,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -814,7 +819,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -866,7 +871,7 @@ 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", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -946,7 +951,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_application_versions_operations.py index caabcdd363df..711a6fc77af0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_applications_operations.py index 106c75d6cb25..905bd04fd1cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_image_versions_operations.py index 033e4dc5fe1a..db0167bf8465 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_images_operations.py index a18533053f2e..0873342e4e60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_sharing_profile_operations.py index 49304b640b6b..2a589a508bc7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -263,7 +268,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_galleries_operations.py index 211310595042..b98c7dd4ef60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_get_request(location: str, gallery_unique_name: str, subscription_id: _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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -232,7 +237,7 @@ def get(self, location: str, gallery_unique_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_image_versions_operations.py index 0b924bb6285e..85d8bb790758 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -274,7 +279,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_images_operations.py index 559e93b90620..683204e0a5f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -249,7 +254,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_configuration.py index 160ede9c59c1..12fba08e91fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-01") # type: str + api_version = kwargs.pop("api_version", "2022-03-01") # type: Literal["2022-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_metadata.json index dd1198bf16bd..a07310ca5ac4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_metadata.json @@ -124,4 +124,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/_configuration.py index 3a48307ba761..bb83f64822b4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-01") # type: str + api_version = kwargs.pop("api_version", "2022-03-01") # type: Literal["2022-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_availability_sets_operations.py index ba172ec6e8a4..28e826e103af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservation_groups_operations.py index b0e7aaa82412..f617a6e05bd2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -301,7 +306,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -376,7 +381,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -443,7 +448,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -506,7 +511,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -598,7 +603,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservations_operations.py index affa2bcc479f..75907c62a165 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -255,7 +260,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -318,7 +323,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -485,7 +490,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -744,7 +749,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_host_groups_operations.py index 37e346e7f3c6..e8b408f9f450 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -433,7 +438,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_hosts_operations.py index cc19dd85c1f8..f8644fcfa168 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -250,7 +255,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -478,7 +483,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -536,7 +541,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -594,7 +599,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -670,7 +675,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -726,7 +731,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { @@ -809,7 +814,7 @@ async def _restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -870,7 +875,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_images_operations.py index 23e1cb6d6b61..d3798e931e82 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_log_analytics_operations.py index aaee06023833..2e524fb9290e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_operations.py index a858c884bcde..e6179ada61c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_proximity_placement_groups_operations.py index 0a784dd09fd7..fc3645b47e57 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_point_collections_operations.py index 474e6a481575..917beda14c69 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -302,7 +307,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -362,7 +367,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -418,7 +423,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -490,7 +495,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -541,7 +546,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -625,7 +630,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_points_operations.py index 9ecb6aae0969..90d0a8d42cb3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_request, build_delete_request, build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -236,7 +241,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -294,7 +299,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -352,7 +357,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -427,7 +432,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_ssh_public_keys_operations.py index d73690b82bd8..04735a8883e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_usage_operations.py index c6bae8d718ee..d6da95ea0b58 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extension_images_operations.py index 1d2611271ab1..9048886ce733 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extensions_operations.py index bbe0590726f0..d0ab6556f025 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index 3bd5255372ed..5f8784b4eb21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_operations.py index a9953c4a0b9d..6747878f8996 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -171,7 +176,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -236,7 +241,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -292,7 +297,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -353,7 +358,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( @@ -414,7 +419,7 @@ async def list_by_edge_zone( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VmImagesInEdgeZoneListResult] request = build_list_by_edge_zone_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_run_commands_operations.py index 14e94cc9d323..acb89cf8dd6f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 3bdd578fe4c1..84a20101fb41 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 1cd137ad2143..a6ec12f7e91f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index d1da58cd2b30..1f7170614db6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 0808e1eb62e2..568217e4af0f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 10a6c8020f92..4df1b315b489 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1678,7 +1683,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1736,7 +1741,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def simulate_eviction( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1853,7 +1858,7 @@ async def _run_command_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2020,7 +2025,7 @@ async def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_sets_operations.py index 53e3921f45f8..2eafdc345a65 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -671,7 +676,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,7 +749,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -797,7 +802,7 @@ async def _deallocate_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -955,7 +960,7 @@ async def begin_deallocate( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -1015,7 +1020,7 @@ async def _delete_instances_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1177,7 +1182,7 @@ async def begin_delete_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -1245,7 +1250,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1295,7 +1300,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1379,7 +1384,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1467,7 +1472,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1556,7 +1561,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1644,7 +1649,7 @@ async def _power_off_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1818,7 +1823,7 @@ async def begin_power_off( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -1878,7 +1883,7 @@ async def _restart_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2030,7 +2035,7 @@ async def begin_restart( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -2089,7 +2094,7 @@ async def _start_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2241,7 +2246,7 @@ async def begin_start( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -2300,7 +2305,7 @@ async def _redeploy_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2455,7 +2460,7 @@ async def begin_redeploy( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -2514,7 +2519,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2675,7 +2680,7 @@ async def begin_perform_maintenance( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -2734,7 +2739,7 @@ async def _update_instances_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2883,7 +2888,7 @@ async def begin_update_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -2942,7 +2947,7 @@ async def _reimage_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3098,7 +3103,7 @@ async def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -3157,7 +3162,7 @@ async def _reimage_all_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3312,7 +3317,7 @@ async def begin_reimage_all( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -3395,7 +3400,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3527,7 +3532,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3587,7 +3592,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3735,7 +3740,7 @@ async def begin_set_orchestration_service_state( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_sizes_operations.py index df22c1088ff9..9d783261d23c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machines_operations.py index 0ac2be7b24e7..149f77bc1807 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1236,7 +1241,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1306,7 +1311,7 @@ async def generalize( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1359,7 +1364,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1452,7 +1457,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1541,7 +1546,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1624,7 +1629,7 @@ async def _power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1685,7 +1690,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1738,7 +1743,7 @@ async def _reapply_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1791,7 +1796,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1843,7 +1848,7 @@ async def _restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1896,7 +1901,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1948,7 +1953,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2001,7 +2006,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2053,7 +2058,7 @@ async def _redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2106,7 +2111,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2162,7 +2167,7 @@ async def _reimage_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2312,7 +2317,7 @@ async def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -2387,7 +2392,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2436,7 +2441,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2491,7 +2496,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2555,7 +2560,7 @@ async def simulate_eviction( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2599,7 +2604,7 @@ async def _assess_patches_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2662,7 +2667,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2722,7 +2727,7 @@ async def _install_patches_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2883,7 +2888,7 @@ async def begin_install_patches( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2942,7 +2947,7 @@ async def _run_command_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3095,7 +3100,7 @@ async def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/models/_models_py3.py index e61e3d61bcf7..c890c748650c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -87,8 +92,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_availability_sets_operations.py index 31a01d836471..f10ee6d86c41 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_list_by_subscription_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -228,7 +233,7 @@ def build_list_available_sizes_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -362,7 +367,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -498,7 +503,7 @@ def 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -570,7 +575,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -673,7 +678,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -755,7 +760,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -842,7 +847,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservation_groups_operations.py index af0953016646..bb84a91f1f52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_by_subscription_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,7 +370,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -510,7 +515,7 @@ def 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -585,7 +590,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -715,7 +720,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -807,7 +812,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservations_operations.py index 4c7a9cbbf998..95256d65549f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -89,7 +94,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -130,7 +135,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_capacity_reservation_group_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -446,7 +451,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -509,7 +514,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -676,7 +681,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -802,7 +807,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -879,7 +884,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -935,7 +940,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_host_groups_operations.py index 5abba2fb4e29..1e7a5f53c82a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +182,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +210,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -480,7 +485,7 @@ def 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -552,7 +557,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -667,7 +672,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -748,7 +753,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_hosts_operations.py index 4c06eecbb8b2..75b62ecf27e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_list_by_host_group_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +222,7 @@ def build_restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +286,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -447,7 +452,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -510,7 +515,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -672,7 +677,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -730,7 +735,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -788,7 +793,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -864,7 +869,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -919,7 +924,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { @@ -1002,7 +1007,7 @@ def _restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1063,7 +1068,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_images_operations.py index 06052f0ecdac..a860e89da35f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_delete_request(resource_group_name: str, image_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -400,7 +405,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -457,7 +462,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -606,7 +611,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -663,7 +668,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -716,7 +721,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -782,7 +787,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -831,7 +836,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -912,7 +917,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_log_analytics_operations.py index b09835b1a05a..59d0280c8049 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_operations.py index 5ea7377e490b..d5074f671318 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_proximity_placement_groups_operations.py index 919b06a73e3c..d823c7ba05bd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -490,7 +495,7 @@ def 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -562,7 +567,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -674,7 +679,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -759,7 +764,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_point_collections_operations.py index 09c84c30037b..9533a67526a1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -496,7 +501,7 @@ def 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -556,7 +561,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,7 +689,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -735,7 +740,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -819,7 +824,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_points_operations.py index c0e503507304..1aefb6e38303 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +200,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -360,7 +365,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -418,7 +423,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -476,7 +481,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -551,7 +556,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_ssh_public_keys_operations.py index c715160f8d5e..59125b12feb9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,7 @@ def build_generate_key_pair_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -283,7 +288,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -369,7 +374,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -527,7 +532,7 @@ def create( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -667,7 +672,7 @@ def 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -739,7 +744,7 @@ 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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -793,7 +798,7 @@ def get(self, resource_group_name: str, ssh_public_key_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -855,7 +860,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_usage_operations.py index 9172038e739e..3e5982131bf5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extension_images_operations.py index af3b88de3f7d..82f026d18a28 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extensions_operations.py index 8e03ce4a011d..a6507f9d8c7a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +189,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -424,7 +429,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -659,7 +664,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -717,7 +722,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -776,7 +781,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -850,7 +855,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -914,7 +919,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_edge_zone_operations.py index 11e15434eaf1..71c50bfaf3d5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: str, subscription_id _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_operations.py index 5d7e19dcba5d..a9831384ec31 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ def build_list_by_edge_zone_request(location: str, edge_zone: str, subscription_ _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +289,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -366,7 +371,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -431,7 +436,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -487,7 +492,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -548,7 +553,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( @@ -607,7 +612,7 @@ def list_by_edge_zone(self, location: str, edge_zone: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VmImagesInEdgeZoneListResult] request = build_list_by_edge_zone_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_run_commands_operations.py index 216aa3d3c646..e1897265d28e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_extensions_operations.py index 64e1ccb8aa81..86c8f2efa5dd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -425,7 +430,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -488,7 +493,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -664,7 +669,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -722,7 +727,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -781,7 +786,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -855,7 +860,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -911,7 +916,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index c1377e1b1157..5488f5c9537e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_cancel_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_start_os_upgrade_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,7 @@ def build_start_extension_upgrade_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +140,7 @@ def build_get_latest_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def _cancel_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -246,7 +251,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -298,7 +303,7 @@ def _start_os_upgrade_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -355,7 +360,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -407,7 +412,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -464,7 +469,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +533,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index fb20c443aded..a3796423339d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 560f95cebc81..fd20a098c218 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,7 +176,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vms_operations.py index 2d132133f95b..e4277af34504 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_reimage_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -184,7 +189,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +263,7 @@ def build_get_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +302,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ def build_power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +413,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -440,7 +445,7 @@ def build_redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -478,7 +483,7 @@ def build_retrieve_boot_diagnostics_data_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -514,7 +519,7 @@ def build_perform_maintenance_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +551,7 @@ def build_simulate_eviction_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -578,7 +583,7 @@ def build_run_command_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -645,7 +650,7 @@ def _reimage_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -807,7 +812,7 @@ def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -863,7 +868,7 @@ def _reimage_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -922,7 +927,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -975,7 +980,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1035,7 +1040,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1093,7 +1098,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1267,7 +1272,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1330,7 +1335,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1397,7 +1402,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1479,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1538,7 +1543,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1609,7 +1614,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1700,7 +1705,7 @@ def _power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1770,7 +1775,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1824,7 +1829,7 @@ def _restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1882,7 +1887,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1935,7 +1940,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1993,7 +1998,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2046,7 +2051,7 @@ def _redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2105,7 +2110,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2182,7 +2187,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2232,7 +2237,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2290,7 +2295,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2357,7 +2362,7 @@ def simulate_eviction( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2407,7 +2412,7 @@ def _run_command_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2571,7 +2576,7 @@ def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_sets_operations.py index d0105062091b..627f5eed9a07 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -145,7 +150,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +188,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -255,7 +260,7 @@ def build_delete_instances_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -291,7 +296,7 @@ def build_get_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ def build_list_all_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -407,7 +412,7 @@ def build_get_os_upgrade_history_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -443,7 +448,7 @@ def build_power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -479,7 +484,7 @@ def build_restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -513,7 +518,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -547,7 +552,7 @@ def build_redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -581,7 +586,7 @@ def build_perform_maintenance_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -615,7 +620,7 @@ def build_update_instances_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -649,7 +654,7 @@ def build_reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -683,7 +688,7 @@ def build_reimage_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -724,7 +729,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -760,7 +765,7 @@ def build_convert_to_single_placement_group_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -794,7 +799,7 @@ def build_set_orchestration_service_state_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -858,7 +863,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -944,7 +949,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1102,7 +1107,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1163,7 +1168,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1317,7 +1322,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1374,7 +1379,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1433,7 +1438,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1506,7 +1511,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1559,7 +1564,7 @@ def _deallocate_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1717,7 +1722,7 @@ def begin_deallocate( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -1777,7 +1782,7 @@ def _delete_instances_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1939,7 +1944,7 @@ def begin_delete_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -2007,7 +2012,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2057,7 +2062,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2141,7 +2146,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2229,7 +2234,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2318,7 +2323,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2406,7 +2411,7 @@ def _power_off_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2580,7 +2585,7 @@ def begin_power_off( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -2640,7 +2645,7 @@ def _restart_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2792,7 +2797,7 @@ def begin_restart( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -2851,7 +2856,7 @@ def _start_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3003,7 +3008,7 @@ def begin_start( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -3062,7 +3067,7 @@ def _redeploy_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3217,7 +3222,7 @@ def begin_redeploy( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -3276,7 +3281,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3437,7 +3442,7 @@ def begin_perform_maintenance( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -3496,7 +3501,7 @@ def _update_instances_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3645,7 +3650,7 @@ def begin_update_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -3704,7 +3709,7 @@ def _reimage_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3860,7 +3865,7 @@ def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -3919,7 +3924,7 @@ def _reimage_all_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4074,7 +4079,7 @@ def begin_reimage_all( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -4157,7 +4162,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4289,7 +4294,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4349,7 +4354,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4497,7 +4502,7 @@ def begin_set_orchestration_service_state( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_sizes_operations.py index 96f5f015e494..202df7592edc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machines_operations.py index c8d4d082fcc5..00a5be225768 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -175,7 +180,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +251,7 @@ def build_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def build_convert_to_managed_disks_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -341,7 +346,7 @@ def build_generalize_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +377,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -404,7 +409,7 @@ def build_list_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -434,7 +439,7 @@ def build_list_available_sizes_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -465,7 +470,7 @@ def build_power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -496,7 +501,7 @@ def build_reapply_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -525,7 +530,7 @@ def build_restart_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -554,7 +559,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -583,7 +588,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -612,7 +617,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -651,7 +656,7 @@ def build_retrieve_boot_diagnostics_data_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -686,7 +691,7 @@ def build_perform_maintenance_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -717,7 +722,7 @@ def build_simulate_eviction_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -748,7 +753,7 @@ def build_assess_patches_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -779,7 +784,7 @@ def build_install_patches_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -813,7 +818,7 @@ def build_run_command_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -875,7 +880,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -961,7 +966,7 @@ def _capture_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1121,7 +1126,7 @@ def begin_capture( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1180,7 +1185,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1335,7 +1340,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1392,7 +1397,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1540,7 +1545,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1597,7 +1602,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1656,7 +1661,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1731,7 +1736,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1792,7 +1797,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1840,7 +1845,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1894,7 +1899,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1946,7 +1951,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -2006,7 +2011,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2076,7 +2081,7 @@ def generalize( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2128,7 +2133,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2220,7 +2225,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2308,7 +2313,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2391,7 +2396,7 @@ def _power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2452,7 +2457,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2505,7 +2510,7 @@ def _reapply_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2558,7 +2563,7 @@ def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2610,7 +2615,7 @@ def _restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2663,7 +2668,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2715,7 +2720,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2768,7 +2773,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2820,7 +2825,7 @@ def _redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2873,7 +2878,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2929,7 +2934,7 @@ def _reimage_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3079,7 +3084,7 @@ def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] 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] @@ -3154,7 +3159,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3203,7 +3208,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3256,7 +3261,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3320,7 +3325,7 @@ def simulate_eviction( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3364,7 +3369,7 @@ def _assess_patches_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3427,7 +3432,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3487,7 +3492,7 @@ def _install_patches_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3648,7 +3653,7 @@ def begin_install_patches( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3707,7 +3712,7 @@ def _run_command_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3857,7 +3862,7 @@ def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_configuration.py index 1bd61b67a16c..0e2544bc13ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-02") # type: str + api_version = kwargs.pop("api_version", "2022-03-02") # type: Literal["2022-03-02"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_metadata.json index a6c3aee92021..c82fbfdf49e0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_metadata.json @@ -103,4 +103,4 @@ "disk_restore_point": "DiskRestorePointOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/_configuration.py index d23c2786eb08..b49afa6d94aa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-02") # type: str + api_version = kwargs.pop("api_version", "2022-03-02") # type: Literal["2022-03-02"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_accesses_operations.py index 1ca694e17cd7..4da61e704a5a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] 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] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # pylint: disable=inco _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_encryption_sets_operations.py index 278cc39e93fa..759fa3ef3807 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_restore_point_operations.py index 49b827c6ff8a..a9ebe968bc71 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -156,7 +161,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -246,7 +251,7 @@ async def _grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -428,7 +433,7 @@ async def begin_grant_access( _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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -494,7 +499,7 @@ async def _revoke_access_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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -562,7 +567,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disks_operations.py index bc183505b704..02e8151c8e00 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_snapshots_operations.py index 93de92b775d7..83eb7ba869aa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_accesses_operations.py index e60d0faddbcd..03b48ffd6132 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] 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] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # pylint: disable=inconsiste _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_encryption_sets_operations.py index f6f49c2c407d..76c8af780b15 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_restore_point_operations.py index 6d432926daf6..4d4a3a1573ca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -313,7 +318,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -403,7 +408,7 @@ def _grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -582,7 +587,7 @@ def begin_grant_access( _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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -648,7 +653,7 @@ def _revoke_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -716,7 +721,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disks_operations.py index abdc7bdfcf18..b824fd77e2a2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: _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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_snapshots_operations.py index 8131a1e7a940..9b6a68ec1e71 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ 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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/__init__.py deleted file mode 100644 index 835f3211b3cd..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._compute_management_client import ComputeManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = ["ComputeManagementClient"] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_compute_management_client.py deleted file mode 100644 index e7ea37e28043..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_compute_management_client.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models -from .._serialization import Deserializer, Serializer -from ._configuration import ComputeManagementClientConfiguration -from .operations import ( - CommunityGalleriesOperations, - CommunityGalleryImageVersionsOperations, - CommunityGalleryImagesOperations, - GalleriesOperations, - GalleryApplicationVersionsOperations, - GalleryApplicationsOperations, - GalleryImageVersionsOperations, - GalleryImagesOperations, - GallerySharingProfileOperations, - SharedGalleriesOperations, - SharedGalleryImageVersionsOperations, - SharedGalleryImagesOperations, -) - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class ComputeManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """Compute Client. - - :ivar galleries: GalleriesOperations operations - :vartype galleries: azure.mgmt.compute.v2022_03_03.operations.GalleriesOperations - :ivar gallery_images: GalleryImagesOperations operations - :vartype gallery_images: azure.mgmt.compute.v2022_03_03.operations.GalleryImagesOperations - :ivar gallery_image_versions: GalleryImageVersionsOperations operations - :vartype gallery_image_versions: - azure.mgmt.compute.v2022_03_03.operations.GalleryImageVersionsOperations - :ivar gallery_applications: GalleryApplicationsOperations operations - :vartype gallery_applications: - azure.mgmt.compute.v2022_03_03.operations.GalleryApplicationsOperations - :ivar gallery_application_versions: GalleryApplicationVersionsOperations operations - :vartype gallery_application_versions: - azure.mgmt.compute.v2022_03_03.operations.GalleryApplicationVersionsOperations - :ivar gallery_sharing_profile: GallerySharingProfileOperations operations - :vartype gallery_sharing_profile: - azure.mgmt.compute.v2022_03_03.operations.GallerySharingProfileOperations - :ivar shared_galleries: SharedGalleriesOperations operations - :vartype shared_galleries: azure.mgmt.compute.v2022_03_03.operations.SharedGalleriesOperations - :ivar shared_gallery_images: SharedGalleryImagesOperations operations - :vartype shared_gallery_images: - azure.mgmt.compute.v2022_03_03.operations.SharedGalleryImagesOperations - :ivar shared_gallery_image_versions: SharedGalleryImageVersionsOperations operations - :vartype shared_gallery_image_versions: - azure.mgmt.compute.v2022_03_03.operations.SharedGalleryImageVersionsOperations - :ivar community_galleries: CommunityGalleriesOperations operations - :vartype community_galleries: - azure.mgmt.compute.v2022_03_03.operations.CommunityGalleriesOperations - :ivar community_gallery_images: CommunityGalleryImagesOperations operations - :vartype community_gallery_images: - azure.mgmt.compute.v2022_03_03.operations.CommunityGalleryImagesOperations - :ivar community_gallery_image_versions: CommunityGalleryImageVersionsOperations operations - :vartype community_gallery_image_versions: - azure.mgmt.compute.v2022_03_03.operations.CommunityGalleryImageVersionsOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-03-03". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = ComputeManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - 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)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.galleries = GalleriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.gallery_images = GalleryImagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.gallery_image_versions = GalleryImageVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.gallery_applications = GalleryApplicationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.gallery_application_versions = GalleryApplicationVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.gallery_sharing_profile = GallerySharingProfileOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.shared_galleries = SharedGalleriesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.shared_gallery_images = SharedGalleryImagesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.shared_gallery_image_versions = SharedGalleryImageVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.community_galleries = CommunityGalleriesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.community_gallery_images = CommunityGalleryImagesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.community_gallery_image_versions = CommunityGalleryImageVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> ComputeManagementClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_configuration.py deleted file mode 100644 index d01841a7fb05..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_configuration.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class ComputeManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for ComputeManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-03-03". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-03") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-compute/{}".format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> 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) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_metadata.json deleted file mode 100644 index 9af32c2ac69d..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_metadata.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "chosen_version": "2022-03-03", - "total_api_version_list": ["2022-03-03"], - "client": { - "name": "ComputeManagementClient", - "filename": "_compute_management_client", - "description": "Compute Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ComputeManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ComputeManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "galleries": "GalleriesOperations", - "gallery_images": "GalleryImagesOperations", - "gallery_image_versions": "GalleryImageVersionsOperations", - "gallery_applications": "GalleryApplicationsOperations", - "gallery_application_versions": "GalleryApplicationVersionsOperations", - "gallery_sharing_profile": "GallerySharingProfileOperations", - "shared_galleries": "SharedGalleriesOperations", - "shared_gallery_images": "SharedGalleryImagesOperations", - "shared_gallery_image_versions": "SharedGalleryImageVersionsOperations", - "community_galleries": "CommunityGalleriesOperations", - "community_gallery_images": "CommunityGalleryImagesOperations", - "community_gallery_image_versions": "CommunityGalleryImageVersionsOperations" - } -} \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_patch.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_vendor.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_vendor.py deleted file mode 100644 index 9aad73fc743e..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py deleted file mode 100644 index a1b6f8ec6763..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "29.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/__init__.py deleted file mode 100644 index 2351b55ffa1d..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._compute_management_client import ComputeManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = ["ComputeManagementClient"] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_compute_management_client.py deleted file mode 100644 index 34cc2f1c05e8..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_compute_management_client.py +++ /dev/null @@ -1,168 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models -from ..._serialization import Deserializer, Serializer -from ._configuration import ComputeManagementClientConfiguration -from .operations import ( - CommunityGalleriesOperations, - CommunityGalleryImageVersionsOperations, - CommunityGalleryImagesOperations, - GalleriesOperations, - GalleryApplicationVersionsOperations, - GalleryApplicationsOperations, - GalleryImageVersionsOperations, - GalleryImagesOperations, - GallerySharingProfileOperations, - SharedGalleriesOperations, - SharedGalleryImageVersionsOperations, - SharedGalleryImagesOperations, -) - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class ComputeManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """Compute Client. - - :ivar galleries: GalleriesOperations operations - :vartype galleries: azure.mgmt.compute.v2022_03_03.aio.operations.GalleriesOperations - :ivar gallery_images: GalleryImagesOperations operations - :vartype gallery_images: azure.mgmt.compute.v2022_03_03.aio.operations.GalleryImagesOperations - :ivar gallery_image_versions: GalleryImageVersionsOperations operations - :vartype gallery_image_versions: - azure.mgmt.compute.v2022_03_03.aio.operations.GalleryImageVersionsOperations - :ivar gallery_applications: GalleryApplicationsOperations operations - :vartype gallery_applications: - azure.mgmt.compute.v2022_03_03.aio.operations.GalleryApplicationsOperations - :ivar gallery_application_versions: GalleryApplicationVersionsOperations operations - :vartype gallery_application_versions: - azure.mgmt.compute.v2022_03_03.aio.operations.GalleryApplicationVersionsOperations - :ivar gallery_sharing_profile: GallerySharingProfileOperations operations - :vartype gallery_sharing_profile: - azure.mgmt.compute.v2022_03_03.aio.operations.GallerySharingProfileOperations - :ivar shared_galleries: SharedGalleriesOperations operations - :vartype shared_galleries: - azure.mgmt.compute.v2022_03_03.aio.operations.SharedGalleriesOperations - :ivar shared_gallery_images: SharedGalleryImagesOperations operations - :vartype shared_gallery_images: - azure.mgmt.compute.v2022_03_03.aio.operations.SharedGalleryImagesOperations - :ivar shared_gallery_image_versions: SharedGalleryImageVersionsOperations operations - :vartype shared_gallery_image_versions: - azure.mgmt.compute.v2022_03_03.aio.operations.SharedGalleryImageVersionsOperations - :ivar community_galleries: CommunityGalleriesOperations operations - :vartype community_galleries: - azure.mgmt.compute.v2022_03_03.aio.operations.CommunityGalleriesOperations - :ivar community_gallery_images: CommunityGalleryImagesOperations operations - :vartype community_gallery_images: - azure.mgmt.compute.v2022_03_03.aio.operations.CommunityGalleryImagesOperations - :ivar community_gallery_image_versions: CommunityGalleryImageVersionsOperations operations - :vartype community_gallery_image_versions: - azure.mgmt.compute.v2022_03_03.aio.operations.CommunityGalleryImageVersionsOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-03-03". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = ComputeManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - 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)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.galleries = GalleriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.gallery_images = GalleryImagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.gallery_image_versions = GalleryImageVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.gallery_applications = GalleryApplicationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.gallery_application_versions = GalleryApplicationVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.gallery_sharing_profile = GallerySharingProfileOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.shared_galleries = SharedGalleriesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.shared_gallery_images = SharedGalleryImagesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.shared_gallery_image_versions = SharedGalleryImageVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.community_galleries = CommunityGalleriesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.community_gallery_images = CommunityGalleryImagesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.community_gallery_image_versions = CommunityGalleryImageVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ComputeManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_configuration.py deleted file mode 100644 index aebb5d655c51..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_configuration.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class ComputeManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for ComputeManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-03-03". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-03") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-compute/{}".format(VERSION)) - self._configure(**kwargs) - - 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) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_patch.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/__init__.py deleted file mode 100644 index aa7e32324e0e..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/__init__.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 ._galleries_operations import GalleriesOperations -from ._gallery_images_operations import GalleryImagesOperations -from ._gallery_image_versions_operations import GalleryImageVersionsOperations -from ._gallery_applications_operations import GalleryApplicationsOperations -from ._gallery_application_versions_operations import GalleryApplicationVersionsOperations -from ._gallery_sharing_profile_operations import GallerySharingProfileOperations -from ._shared_galleries_operations import SharedGalleriesOperations -from ._shared_gallery_images_operations import SharedGalleryImagesOperations -from ._shared_gallery_image_versions_operations import SharedGalleryImageVersionsOperations -from ._community_galleries_operations import CommunityGalleriesOperations -from ._community_gallery_images_operations import CommunityGalleryImagesOperations -from ._community_gallery_image_versions_operations import CommunityGalleryImageVersionsOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "GalleriesOperations", - "GalleryImagesOperations", - "GalleryImageVersionsOperations", - "GalleryApplicationsOperations", - "GalleryApplicationVersionsOperations", - "GallerySharingProfileOperations", - "SharedGalleriesOperations", - "SharedGalleryImagesOperations", - "SharedGalleryImageVersionsOperations", - "CommunityGalleriesOperations", - "CommunityGalleryImagesOperations", - "CommunityGalleryImageVersionsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_galleries_operations.py deleted file mode 100644 index 5b434cf2db06..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_galleries_operations.py +++ /dev/null @@ -1,109 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._community_galleries_operations import build_get_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class CommunityGalleriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`community_galleries` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, location: str, public_gallery_name: str, **kwargs: Any) -> _models.CommunityGallery: - """Get a community gallery by gallery public name. - - :param location: Resource location. Required. - :type location: str - :param public_gallery_name: The public name of the community gallery. Required. - :type public_gallery_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CommunityGallery or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.CommunityGallery - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGallery] - - request = build_get_request( - location=location, - public_gallery_name=public_gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CommunityGallery", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_image_versions_operations.py deleted file mode 100644 index ab91f5a61b64..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_image_versions_operations.py +++ /dev/null @@ -1,220 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._community_gallery_image_versions_operations import build_get_request, build_list_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class CommunityGalleryImageVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`community_gallery_image_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, - location: str, - public_gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - **kwargs: Any - ) -> _models.CommunityGalleryImageVersion: - """Get a community gallery image version. - - :param location: Resource location. Required. - :type location: str - :param public_gallery_name: The public name of the community gallery. Required. - :type public_gallery_name: str - :param gallery_image_name: The name of the community gallery image definition. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the community gallery image version. Needs to - follow semantic version name pattern: The allowed characters are digit and period. Digits must - be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CommunityGalleryImageVersion or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImageVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersion] - - request = build_get_request( - location=location, - public_gallery_name=public_gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CommunityGalleryImageVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @distributed_trace - def list( - self, location: str, public_gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> AsyncIterable["_models.CommunityGalleryImageVersion"]: - """List community gallery image versions inside an image. - - :param location: Resource location. Required. - :type location: str - :param public_gallery_name: The public name of the community gallery. Required. - :type public_gallery_name: str - :param gallery_image_name: The name of the community gallery image definition. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CommunityGalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersionList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - location=location, - public_gallery_name=public_gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CommunityGalleryImageVersionList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_images_operations.py deleted file mode 100644 index 9b79a3c0fbdf..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_images_operations.py +++ /dev/null @@ -1,206 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._community_gallery_images_operations import build_get_request, build_list_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class CommunityGalleryImagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`community_gallery_images` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, location: str, public_gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> _models.CommunityGalleryImage: - """Get a community gallery image. - - :param location: Resource location. Required. - :type location: str - :param public_gallery_name: The public name of the community gallery. Required. - :type public_gallery_name: str - :param gallery_image_name: The name of the community gallery image definition. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CommunityGalleryImage or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImage - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImage] - - request = build_get_request( - location=location, - public_gallery_name=public_gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CommunityGalleryImage", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}"} # type: ignore - - @distributed_trace - def list( - self, location: str, public_gallery_name: str, **kwargs: Any - ) -> AsyncIterable["_models.CommunityGalleryImage"]: - """List community gallery images inside a gallery. - - :param location: Resource location. Required. - :type location: str - :param public_gallery_name: The public name of the community gallery. Required. - :type public_gallery_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CommunityGalleryImage or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - location=location, - public_gallery_name=public_gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CommunityGalleryImageList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_galleries_operations.py deleted file mode 100644 index 5f884d927d17..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_galleries_operations.py +++ /dev/null @@ -1,833 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._galleries_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GalleriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`galleries` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_or_update_initial( - self, resource_group_name: str, gallery_name: str, gallery: Union[_models.Gallery, IO], **kwargs: Any - ) -> _models.Gallery: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery, (IO, bytes)): - _content = gallery - else: - _json = self._serialize.body(gallery, "Gallery") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Gallery", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("Gallery", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Gallery", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery: _models.Gallery, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Gallery]: - """Create or update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. - Required. - :type gallery: ~azure.mgmt.compute.v2022_03_03.models.Gallery - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Gallery or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Gallery]: - """Create or update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. - Required. - :type gallery: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Gallery or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, resource_group_name: str, gallery_name: str, gallery: Union[_models.Gallery, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.Gallery]: - """Create or update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. Is - either a model type or a IO type. Required. - :type gallery: ~azure.mgmt.compute.v2022_03_03.models.Gallery or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Gallery or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery=gallery, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Gallery", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - async def _update_initial( - self, resource_group_name: str, gallery_name: str, gallery: Union[_models.GalleryUpdate, IO], **kwargs: Any - ) -> _models.Gallery: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery, (IO, bytes)): - _content = gallery - else: - _json = self._serialize.body(gallery, "GalleryUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Gallery", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery: _models.GalleryUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Gallery]: - """Update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the update Shared Image Gallery operation. Required. - :type gallery: ~azure.mgmt.compute.v2022_03_03.models.GalleryUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Gallery or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Gallery]: - """Update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the update Shared Image Gallery operation. Required. - :type gallery: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Gallery or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, resource_group_name: str, gallery_name: str, gallery: Union[_models.GalleryUpdate, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.Gallery]: - """Update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the update Shared Image Gallery operation. Is either a - model type or a IO type. Required. - :type gallery: ~azure.mgmt.compute.v2022_03_03.models.GalleryUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Gallery or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery=gallery, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Gallery", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - gallery_name: str, - select: Optional[Union[str, _models.SelectPermissions]] = None, - expand: Optional[Union[str, _models.GalleryExpandParams]] = None, - **kwargs: Any - ) -> _models.Gallery: - """Retrieves information about a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. Required. - :type gallery_name: str - :param select: The select expression to apply on the operation. "Permissions" Default value is - None. - :type select: str or ~azure.mgmt.compute.v2022_03_03.models.SelectPermissions - :param expand: The expand query option to apply on the operation. "SharingProfile/Groups" - Default value is None. - :type expand: str or ~azure.mgmt.compute.v2022_03_03.models.GalleryExpandParams - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Gallery or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.Gallery - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - - request = build_get_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - select=select, - expand=expand, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Gallery", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, gallery_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery to be deleted. Required. - :type gallery_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: - """List galleries under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Gallery or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries"} # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: - """List galleries under a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Gallery or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_application_versions_operations.py deleted file mode 100644 index 0851a88396d0..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_application_versions_operations.py +++ /dev/null @@ -1,888 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._gallery_application_versions_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_gallery_application_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GalleryApplicationVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`gallery_application_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_or_update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: Union[_models.GalleryApplicationVersion, IO], - **kwargs: Any - ) -> _models.GalleryApplicationVersion: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_application_version, (IO, bytes)): - _content = gallery_application_version - else: - _json = self._serialize.body(gallery_application_version, "GalleryApplicationVersion") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: _models.GalleryApplicationVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplicationVersion]: - """Create or update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. Required. - :type gallery_application_version: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplicationVersion]: - """Create or update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. Required. - :type gallery_application_version: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: Union[_models.GalleryApplicationVersion, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplicationVersion]: - """Create or update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. Is either a model type or a IO type. Required. - :type gallery_application_version: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - gallery_application_version=gallery_application_version, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: Union[_models.GalleryApplicationVersionUpdate, IO], - **kwargs: Any - ) -> _models.GalleryApplicationVersion: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_application_version, (IO, bytes)): - _content = gallery_application_version - else: - _json = self._serialize.body(gallery_application_version, "GalleryApplicationVersionUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: _models.GalleryApplicationVersionUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplicationVersion]: - """Update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be updated. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - updated. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the update gallery Application - Version operation. Required. - :type gallery_application_version: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplicationVersion]: - """Update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be updated. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - updated. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the update gallery Application - Version operation. Required. - :type gallery_application_version: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: Union[_models.GalleryApplicationVersionUpdate, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplicationVersion]: - """Update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be updated. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - updated. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the update gallery Application - Version operation. Is either a model type or a IO type. Required. - :type gallery_application_version: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplicationVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - gallery_application_version=gallery_application_version, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - expand: Optional[Union[str, _models.ReplicationStatusTypes]] = None, - **kwargs: Any - ) -> _models.GalleryApplicationVersion: - """Retrieves information about a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version resides. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - retrieved. Required. - :type gallery_application_version_name: str - :param expand: The expand expression to apply on the operation. "ReplicationStatus" Default - value is None. - :type expand: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationStatusTypes - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GalleryApplicationVersion or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] - - request = build_get_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version resides. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - deleted. Required. - :type gallery_application_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - @distributed_trace - def list_by_gallery_application( - self, resource_group_name: str, gallery_name: str, gallery_application_name: str, **kwargs: Any - ) -> AsyncIterable["_models.GalleryApplicationVersion"]: - """List gallery Application Versions in a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the Shared Application Gallery Application - Definition from which the Application Versions are to be listed. Required. - :type gallery_application_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either GalleryApplicationVersion or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_gallery_application_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_gallery_application.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryApplicationVersionList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_gallery_application.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_applications_operations.py deleted file mode 100644 index 95d5b5a5e757..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_applications_operations.py +++ /dev/null @@ -1,815 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._gallery_applications_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_gallery_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GalleryApplicationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`gallery_applications` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_or_update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: Union[_models.GalleryApplication, IO], - **kwargs: Any - ) -> _models.GalleryApplication: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_application, (IO, bytes)): - _content = gallery_application - else: - _json = self._serialize.body(gallery_application, "GalleryApplication") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("GalleryApplication", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("GalleryApplication", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("GalleryApplication", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: _models.GalleryApplication, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplication]: - """Create or update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the create or update gallery Application - operation. Required. - :type gallery_application: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplication - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplication]: - """Create or update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the create or update gallery Application - operation. Required. - :type gallery_application: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: Union[_models.GalleryApplication, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplication]: - """Create or update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the create or update gallery Application - operation. Is either a model type or a IO type. Required. - :type gallery_application: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplication or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application=gallery_application, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryApplication", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: Union[_models.GalleryApplicationUpdate, IO], - **kwargs: Any - ) -> _models.GalleryApplication: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_application, (IO, bytes)): - _content = gallery_application - else: - _json = self._serialize.body(gallery_application, "GalleryApplicationUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryApplication", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: _models.GalleryApplicationUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplication]: - """Update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be updated. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the update gallery Application operation. - Required. - :type gallery_application: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplication]: - """Update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be updated. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the update gallery Application operation. - Required. - :type gallery_application: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: Union[_models.GalleryApplicationUpdate, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryApplication]: - """Update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be updated. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the update gallery Application operation. Is - either a model type or a IO type. Required. - :type gallery_application: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationUpdate or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application=gallery_application, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryApplication", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, gallery_name: str, gallery_application_name: str, **kwargs: Any - ) -> _models.GalleryApplication: - """Retrieves information about a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery from which the Application - Definitions are to be retrieved. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be - retrieved. Required. - :type gallery_application_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GalleryApplication or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplication - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] - - request = build_get_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryApplication", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, gallery_name: str, gallery_application_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, gallery_name: str, gallery_application_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a gallery Application. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be deleted. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be deleted. - Required. - :type gallery_application_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - @distributed_trace - def list_by_gallery( - self, resource_group_name: str, gallery_name: str, **kwargs: Any - ) -> AsyncIterable["_models.GalleryApplication"]: - """List gallery Application Definitions in a gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery from which Application - Definitions are to be listed. Required. - :type gallery_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either GalleryApplication or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_gallery_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_gallery.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryApplicationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_gallery.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_image_versions_operations.py deleted file mode 100644 index cc25480b1dfc..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_image_versions_operations.py +++ /dev/null @@ -1,884 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._gallery_image_versions_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_gallery_image_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GalleryImageVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`gallery_image_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_or_update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: Union[_models.GalleryImageVersion, IO], - **kwargs: Any - ) -> _models.GalleryImageVersion: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_image_version, (IO, bytes)): - _content = gallery_image_version - else: - _json = self._serialize.body(gallery_image_version, "GalleryImageVersion") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: _models.GalleryImageVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImageVersion]: - """Create or update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be created. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the create or update gallery image version - operation. Required. - :type gallery_image_version: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImageVersion]: - """Create or update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be created. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the create or update gallery image version - operation. Required. - :type gallery_image_version: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: Union[_models.GalleryImageVersion, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImageVersion]: - """Create or update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be created. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the create or update gallery image version - operation. Is either a model type or a IO type. Required. - :type gallery_image_version: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - gallery_image_version=gallery_image_version, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: Union[_models.GalleryImageVersionUpdate, IO], - **kwargs: Any - ) -> _models.GalleryImageVersion: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_image_version, (IO, bytes)): - _content = gallery_image_version - else: - _json = self._serialize.body(gallery_image_version, "GalleryImageVersionUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: _models.GalleryImageVersionUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImageVersion]: - """Update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be updated. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be updated. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the update gallery image version - operation. Required. - :type gallery_image_version: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImageVersion]: - """Update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be updated. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be updated. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the update gallery image version - operation. Required. - :type gallery_image_version: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: Union[_models.GalleryImageVersionUpdate, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImageVersion]: - """Update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be updated. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be updated. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the update gallery image version - operation. Is either a model type or a IO type. Required. - :type gallery_image_version: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionUpdate - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - gallery_image_version=gallery_image_version, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - expand: Optional[Union[str, _models.ReplicationStatusTypes]] = None, - **kwargs: Any - ) -> _models.GalleryImageVersion: - """Retrieves information about a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - resides. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be retrieved. - Required. - :type gallery_image_version_name: str - :param expand: The expand expression to apply on the operation. "ReplicationStatus" Default - value is None. - :type expand: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationStatusTypes - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GalleryImageVersion or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] - - request = build_get_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - resides. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be deleted. - Required. - :type gallery_image_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @distributed_trace - def list_by_gallery_image( - self, resource_group_name: str, gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> AsyncIterable["_models.GalleryImageVersion"]: - """List gallery image versions in a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the - Image Versions are to be listed. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either GalleryImageVersion or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_gallery_image_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_gallery_image.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryImageVersionList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_gallery_image.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_images_operations.py deleted file mode 100644 index ea35c2799906..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_images_operations.py +++ /dev/null @@ -1,804 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._gallery_images_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_gallery_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GalleryImagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`gallery_images` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_or_update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: Union[_models.GalleryImage, IO], - **kwargs: Any - ) -> _models.GalleryImage: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_image, (IO, bytes)): - _content = gallery_image - else: - _json = self._serialize.body(gallery_image, "GalleryImage") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("GalleryImage", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("GalleryImage", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("GalleryImage", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: _models.GalleryImage, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImage]: - """Create or update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the create or update gallery image operation. - Required. - :type gallery_image: ~azure.mgmt.compute.v2022_03_03.models.GalleryImage - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImage]: - """Create or update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the create or update gallery image operation. - Required. - :type gallery_image: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: Union[_models.GalleryImage, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImage]: - """Create or update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the create or update gallery image operation. Is - either a model type or a IO type. Required. - :type gallery_image: ~azure.mgmt.compute.v2022_03_03.models.GalleryImage or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image=gallery_image, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryImage", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: Union[_models.GalleryImageUpdate, IO], - **kwargs: Any - ) -> _models.GalleryImage: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_image, (IO, bytes)): - _content = gallery_image - else: - _json = self._serialize.body(gallery_image, "GalleryImageUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryImage", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: _models.GalleryImageUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImage]: - """Update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be updated. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be updated. The allowed - characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the update gallery image operation. Required. - :type gallery_image: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImage]: - """Update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be updated. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be updated. The allowed - characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the update gallery image operation. Required. - :type gallery_image: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: Union[_models.GalleryImageUpdate, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.GalleryImage]: - """Update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be updated. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be updated. The allowed - characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the update gallery image operation. Is either a - model type or a IO type. Required. - :type gallery_image: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image=gallery_image, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryImage", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> _models.GalleryImage: - """Retrieves information about a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery from which the Image Definitions are - to be retrieved. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be retrieved. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GalleryImage or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.GalleryImage - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] - - request = build_get_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryImage", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a gallery image. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be deleted. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be deleted. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - @distributed_trace - def list_by_gallery( - self, resource_group_name: str, gallery_name: str, **kwargs: Any - ) -> AsyncIterable["_models.GalleryImage"]: - """List gallery image definitions in a gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to - be listed. Required. - :type gallery_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either GalleryImage or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_gallery_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_gallery.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryImageList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_gallery.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_sharing_profile_operations.py deleted file mode 100644 index 9889f73c0e29..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_sharing_profile_operations.py +++ /dev/null @@ -1,273 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._gallery_sharing_profile_operations import build_update_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GallerySharingProfileOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`gallery_sharing_profile` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _update_initial( - self, - resource_group_name: str, - gallery_name: str, - sharing_update: Union[_models.SharingUpdate, IO], - **kwargs: Any - ) -> _models.SharingUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(sharing_update, (IO, bytes)): - _content = sharing_update - else: - _json = self._serialize.body(sharing_update, "SharingUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("SharingUpdate", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("SharingUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share"} # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - sharing_update: _models.SharingUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SharingUpdate]: - """Update sharing profile of a gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. Required. - :type gallery_name: str - :param sharing_update: Parameters supplied to the update gallery sharing profile. Required. - :type sharing_update: ~azure.mgmt.compute.v2022_03_03.models.SharingUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either SharingUpdate or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.SharingUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - sharing_update: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SharingUpdate]: - """Update sharing profile of a gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. Required. - :type gallery_name: str - :param sharing_update: Parameters supplied to the update gallery sharing profile. Required. - :type sharing_update: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either SharingUpdate or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.SharingUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - gallery_name: str, - sharing_update: Union[_models.SharingUpdate, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.SharingUpdate]: - """Update sharing profile of a gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. Required. - :type gallery_name: str - :param sharing_update: Parameters supplied to the update gallery sharing profile. Is either a - model type or a IO type. Required. - :type sharing_update: ~azure.mgmt.compute.v2022_03_03.models.SharingUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either SharingUpdate or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_03_03.models.SharingUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - sharing_update=sharing_update, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SharingUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_patch.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_galleries_operations.py deleted file mode 100644 index 21ca90fcc9c1..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_galleries_operations.py +++ /dev/null @@ -1,201 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._shared_galleries_operations import build_get_request, build_list_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SharedGalleriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`shared_galleries` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, location: str, shared_to: Optional[Union[str, _models.SharedToValues]] = None, **kwargs: Any - ) -> AsyncIterable["_models.SharedGallery"]: - """List shared galleries by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param shared_to: The query parameter to decide what shared galleries to fetch when doing - listing operations. "tenant" Default value is None. - :type shared_to: str or ~azure.mgmt.compute.v2022_03_03.models.SharedToValues - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SharedGallery or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.SharedGallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - shared_to=shared_to, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SharedGalleryList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries"} # type: ignore - - @distributed_trace_async - async def get(self, location: str, gallery_unique_name: str, **kwargs: Any) -> _models.SharedGallery: - """Get a shared gallery by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param gallery_unique_name: The unique name of the Shared Gallery. Required. - :type gallery_unique_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SharedGallery or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.SharedGallery - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] - - request = build_get_request( - location=location, - gallery_unique_name=gallery_unique_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SharedGallery", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_image_versions_operations.py deleted file mode 100644 index 503696d8cd5c..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_image_versions_operations.py +++ /dev/null @@ -1,231 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._shared_gallery_image_versions_operations import build_get_request, build_list_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SharedGalleryImageVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`shared_gallery_image_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - location: str, - gallery_unique_name: str, - gallery_image_name: str, - shared_to: Optional[Union[str, _models.SharedToValues]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SharedGalleryImageVersion"]: - """List shared gallery image versions by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param gallery_unique_name: The unique name of the Shared Gallery. Required. - :type gallery_unique_name: str - :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image - Versions are to be listed. Required. - :type gallery_image_name: str - :param shared_to: The query parameter to decide what shared galleries to fetch when doing - listing operations. "tenant" Default value is None. - :type shared_to: str or ~azure.mgmt.compute.v2022_03_03.models.SharedToValues - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SharedGalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - location=location, - gallery_unique_name=gallery_unique_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - shared_to=shared_to, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SharedGalleryImageVersionList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions"} # type: ignore - - @distributed_trace_async - async def get( - self, - location: str, - gallery_unique_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - **kwargs: Any - ) -> _models.SharedGalleryImageVersion: - """Get a shared gallery image version by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param gallery_unique_name: The unique name of the Shared Gallery. Required. - :type gallery_unique_name: str - :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image - Versions are to be listed. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SharedGalleryImageVersion or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImageVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] - - request = build_get_request( - location=location, - gallery_unique_name=gallery_unique_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SharedGalleryImageVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_images_operations.py deleted file mode 100644 index 7ce8b02334c1..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_images_operations.py +++ /dev/null @@ -1,214 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._shared_gallery_images_operations import build_get_request, build_list_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SharedGalleryImagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.aio.ComputeManagementClient`'s - :attr:`shared_gallery_images` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - location: str, - gallery_unique_name: str, - shared_to: Optional[Union[str, _models.SharedToValues]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SharedGalleryImage"]: - """List shared gallery images by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param gallery_unique_name: The unique name of the Shared Gallery. Required. - :type gallery_unique_name: str - :param shared_to: The query parameter to decide what shared galleries to fetch when doing - listing operations. "tenant" Default value is None. - :type shared_to: str or ~azure.mgmt.compute.v2022_03_03.models.SharedToValues - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SharedGalleryImage or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - location=location, - gallery_unique_name=gallery_unique_name, - subscription_id=self._config.subscription_id, - shared_to=shared_to, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SharedGalleryImageList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images"} # type: ignore - - @distributed_trace_async - async def get( - self, location: str, gallery_unique_name: str, gallery_image_name: str, **kwargs: Any - ) -> _models.SharedGalleryImage: - """Get a shared gallery image by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param gallery_unique_name: The unique name of the Shared Gallery. Required. - :type gallery_unique_name: str - :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image - Versions are to be listed. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SharedGalleryImage or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImage - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] - - request = build_get_request( - location=location, - gallery_unique_name=gallery_unique_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SharedGalleryImage", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/__init__.py deleted file mode 100644 index 164dff985f0f..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/__init__.py +++ /dev/null @@ -1,231 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._models_py3 import ApiError -from ._models_py3 import ApiErrorBase -from ._models_py3 import CommunityGallery -from ._models_py3 import CommunityGalleryImage -from ._models_py3 import CommunityGalleryImageList -from ._models_py3 import CommunityGalleryImageVersion -from ._models_py3 import CommunityGalleryImageVersionList -from ._models_py3 import CommunityGalleryInfo -from ._models_py3 import DataDiskImageEncryption -from ._models_py3 import Disallowed -from ._models_py3 import DiskImageEncryption -from ._models_py3 import EncryptionImages -from ._models_py3 import Gallery -from ._models_py3 import GalleryApplication -from ._models_py3 import GalleryApplicationCustomAction -from ._models_py3 import GalleryApplicationCustomActionParameter -from ._models_py3 import GalleryApplicationList -from ._models_py3 import GalleryApplicationUpdate -from ._models_py3 import GalleryApplicationVersion -from ._models_py3 import GalleryApplicationVersionList -from ._models_py3 import GalleryApplicationVersionPublishingProfile -from ._models_py3 import GalleryApplicationVersionSafetyProfile -from ._models_py3 import GalleryApplicationVersionUpdate -from ._models_py3 import GalleryArtifactPublishingProfileBase -from ._models_py3 import GalleryArtifactSafetyProfileBase -from ._models_py3 import GalleryArtifactSource -from ._models_py3 import GalleryArtifactVersionFullSource -from ._models_py3 import GalleryArtifactVersionSource -from ._models_py3 import GalleryDataDiskImage -from ._models_py3 import GalleryDiskImage -from ._models_py3 import GalleryDiskImageSource -from ._models_py3 import GalleryExtendedLocation -from ._models_py3 import GalleryIdentifier -from ._models_py3 import GalleryImage -from ._models_py3 import GalleryImageFeature -from ._models_py3 import GalleryImageIdentifier -from ._models_py3 import GalleryImageList -from ._models_py3 import GalleryImageUpdate -from ._models_py3 import GalleryImageVersion -from ._models_py3 import GalleryImageVersionList -from ._models_py3 import GalleryImageVersionPublishingProfile -from ._models_py3 import GalleryImageVersionSafetyProfile -from ._models_py3 import GalleryImageVersionStorageProfile -from ._models_py3 import GalleryImageVersionUpdate -from ._models_py3 import GalleryList -from ._models_py3 import GalleryOSDiskImage -from ._models_py3 import GalleryTargetExtendedLocation -from ._models_py3 import GalleryUpdate -from ._models_py3 import ImagePurchasePlan -from ._models_py3 import InnerError -from ._models_py3 import LatestGalleryImageVersion -from ._models_py3 import ManagedArtifact -from ._models_py3 import OSDiskImageEncryption -from ._models_py3 import OSDiskImageSecurityProfile -from ._models_py3 import PirCommunityGalleryResource -from ._models_py3 import PirResource -from ._models_py3 import PirSharedGalleryResource -from ._models_py3 import PolicyViolation -from ._models_py3 import RecommendedMachineConfiguration -from ._models_py3 import RegionalReplicationStatus -from ._models_py3 import RegionalSharingStatus -from ._models_py3 import ReplicationStatus -from ._models_py3 import Resource -from ._models_py3 import ResourceRange -from ._models_py3 import SharedGallery -from ._models_py3 import SharedGalleryDataDiskImage -from ._models_py3 import SharedGalleryDiskImage -from ._models_py3 import SharedGalleryImage -from ._models_py3 import SharedGalleryImageList -from ._models_py3 import SharedGalleryImageVersion -from ._models_py3 import SharedGalleryImageVersionList -from ._models_py3 import SharedGalleryImageVersionStorageProfile -from ._models_py3 import SharedGalleryList -from ._models_py3 import SharedGalleryOSDiskImage -from ._models_py3 import SharingProfile -from ._models_py3 import SharingProfileGroup -from ._models_py3 import SharingStatus -from ._models_py3 import SharingUpdate -from ._models_py3 import SoftDeletePolicy -from ._models_py3 import TargetRegion -from ._models_py3 import UpdateResourceDefinition -from ._models_py3 import UserArtifactManage -from ._models_py3 import UserArtifactSettings -from ._models_py3 import UserArtifactSource - -from ._compute_management_client_enums import AggregatedReplicationState -from ._compute_management_client_enums import Architecture -from ._compute_management_client_enums import ConfidentialVMEncryptionType -from ._compute_management_client_enums import GalleryApplicationCustomActionParameterType -from ._compute_management_client_enums import GalleryExpandParams -from ._compute_management_client_enums import GalleryExtendedLocationType -from ._compute_management_client_enums import GalleryProvisioningState -from ._compute_management_client_enums import GallerySharingPermissionTypes -from ._compute_management_client_enums import HostCaching -from ._compute_management_client_enums import HyperVGeneration -from ._compute_management_client_enums import OperatingSystemStateTypes -from ._compute_management_client_enums import OperatingSystemTypes -from ._compute_management_client_enums import PolicyViolationCategory -from ._compute_management_client_enums import ReplicationMode -from ._compute_management_client_enums import ReplicationState -from ._compute_management_client_enums import ReplicationStatusTypes -from ._compute_management_client_enums import SelectPermissions -from ._compute_management_client_enums import SharedGalleryHostCaching -from ._compute_management_client_enums import SharedToValues -from ._compute_management_client_enums import SharingProfileGroupTypes -from ._compute_management_client_enums import SharingState -from ._compute_management_client_enums import SharingUpdateOperationTypes -from ._compute_management_client_enums import StorageAccountType -from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ApiError", - "ApiErrorBase", - "CommunityGallery", - "CommunityGalleryImage", - "CommunityGalleryImageList", - "CommunityGalleryImageVersion", - "CommunityGalleryImageVersionList", - "CommunityGalleryInfo", - "DataDiskImageEncryption", - "Disallowed", - "DiskImageEncryption", - "EncryptionImages", - "Gallery", - "GalleryApplication", - "GalleryApplicationCustomAction", - "GalleryApplicationCustomActionParameter", - "GalleryApplicationList", - "GalleryApplicationUpdate", - "GalleryApplicationVersion", - "GalleryApplicationVersionList", - "GalleryApplicationVersionPublishingProfile", - "GalleryApplicationVersionSafetyProfile", - "GalleryApplicationVersionUpdate", - "GalleryArtifactPublishingProfileBase", - "GalleryArtifactSafetyProfileBase", - "GalleryArtifactSource", - "GalleryArtifactVersionFullSource", - "GalleryArtifactVersionSource", - "GalleryDataDiskImage", - "GalleryDiskImage", - "GalleryDiskImageSource", - "GalleryExtendedLocation", - "GalleryIdentifier", - "GalleryImage", - "GalleryImageFeature", - "GalleryImageIdentifier", - "GalleryImageList", - "GalleryImageUpdate", - "GalleryImageVersion", - "GalleryImageVersionList", - "GalleryImageVersionPublishingProfile", - "GalleryImageVersionSafetyProfile", - "GalleryImageVersionStorageProfile", - "GalleryImageVersionUpdate", - "GalleryList", - "GalleryOSDiskImage", - "GalleryTargetExtendedLocation", - "GalleryUpdate", - "ImagePurchasePlan", - "InnerError", - "LatestGalleryImageVersion", - "ManagedArtifact", - "OSDiskImageEncryption", - "OSDiskImageSecurityProfile", - "PirCommunityGalleryResource", - "PirResource", - "PirSharedGalleryResource", - "PolicyViolation", - "RecommendedMachineConfiguration", - "RegionalReplicationStatus", - "RegionalSharingStatus", - "ReplicationStatus", - "Resource", - "ResourceRange", - "SharedGallery", - "SharedGalleryDataDiskImage", - "SharedGalleryDiskImage", - "SharedGalleryImage", - "SharedGalleryImageList", - "SharedGalleryImageVersion", - "SharedGalleryImageVersionList", - "SharedGalleryImageVersionStorageProfile", - "SharedGalleryList", - "SharedGalleryOSDiskImage", - "SharingProfile", - "SharingProfileGroup", - "SharingStatus", - "SharingUpdate", - "SoftDeletePolicy", - "TargetRegion", - "UpdateResourceDefinition", - "UserArtifactManage", - "UserArtifactSettings", - "UserArtifactSource", - "AggregatedReplicationState", - "Architecture", - "ConfidentialVMEncryptionType", - "GalleryApplicationCustomActionParameterType", - "GalleryExpandParams", - "GalleryExtendedLocationType", - "GalleryProvisioningState", - "GallerySharingPermissionTypes", - "HostCaching", - "HyperVGeneration", - "OperatingSystemStateTypes", - "OperatingSystemTypes", - "PolicyViolationCategory", - "ReplicationMode", - "ReplicationState", - "ReplicationStatusTypes", - "SelectPermissions", - "SharedGalleryHostCaching", - "SharedToValues", - "SharingProfileGroupTypes", - "SharingState", - "SharingUpdateOperationTypes", - "StorageAccountType", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_compute_management_client_enums.py deleted file mode 100644 index 0384ea6c9b6b..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_compute_management_client_enums.py +++ /dev/null @@ -1,207 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AggregatedReplicationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This is the aggregated replication status based on all the regional replication status flags.""" - - UNKNOWN = "Unknown" - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - - -class Architecture(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The architecture of the image. Applicable to OS disks only.""" - - X64 = "x64" - ARM64 = "Arm64" - - -class ConfidentialVMEncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """confidential VM encryption types.""" - - ENCRYPTED_VM_GUEST_STATE_ONLY_WITH_PMK = "EncryptedVMGuestStateOnlyWithPmk" - ENCRYPTED_WITH_PMK = "EncryptedWithPmk" - ENCRYPTED_WITH_CMK = "EncryptedWithCmk" - - -class GalleryApplicationCustomActionParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies the type of the custom action parameter. Possible values are: String, - ConfigurationDataBlob or LogOutputBlob. - """ - - STRING = "String" - CONFIGURATION_DATA_BLOB = "ConfigurationDataBlob" - LOG_OUTPUT_BLOB = "LogOutputBlob" - - -class GalleryExpandParams(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """GalleryExpandParams.""" - - SHARING_PROFILE_GROUPS = "SharingProfile/Groups" - - -class GalleryExtendedLocationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """It is type of the extended location.""" - - EDGE_ZONE = "EdgeZone" - UNKNOWN = "Unknown" - - -class GalleryProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state, which only appears in the response.""" - - CREATING = "Creating" - UPDATING = "Updating" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - DELETING = "Deleting" - MIGRATING = "Migrating" - - -class GallerySharingPermissionTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This property allows you to specify the permission of sharing gallery. :code:`
`:code:`
` - Possible values are: :code:`
`:code:`
` **Private** :code:`
`:code:`
` **Groups** - :code:`
`:code:`
` **Community**. - """ - - PRIVATE = "Private" - GROUPS = "Groups" - COMMUNITY = "Community" - - -class HostCaching(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'.""" - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - - -class HyperVGeneration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The hypervisor generation of the Virtual Machine. Applicable to OS disks only.""" - - V1 = "V1" - V2 = "V2" - - -class OperatingSystemStateTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This property allows the user to specify whether the virtual machines created under this image - are 'Generalized' or 'Specialized'. - """ - - GENERALIZED = "Generalized" - SPECIALIZED = "Specialized" - - -class OperatingSystemTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This property allows you to specify the supported type of the OS that application is built for. - :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Windows** - :code:`
`:code:`
` **Linux**. - """ - - WINDOWS = "Windows" - LINUX = "Linux" - - -class PolicyViolationCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Describes the nature of the policy violation.""" - - OTHER = "Other" - IMAGE_FLAGGED_UNSAFE = "ImageFlaggedUnsafe" - COPYRIGHT_VALIDATION = "CopyrightValidation" - IP_THEFT = "IpTheft" - - -class ReplicationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Optional parameter which specifies the mode to be used for replication. This property is not - updatable. - """ - - FULL = "Full" - SHALLOW = "Shallow" - - -class ReplicationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This is the regional replication state.""" - - UNKNOWN = "Unknown" - REPLICATING = "Replicating" - COMPLETED = "Completed" - FAILED = "Failed" - - -class ReplicationStatusTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ReplicationStatusTypes.""" - - REPLICATION_STATUS = "ReplicationStatus" - - -class SelectPermissions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SelectPermissions.""" - - PERMISSIONS = "Permissions" - - -class SharedGalleryHostCaching(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'.""" - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - - -class SharedToValues(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SharedToValues.""" - - TENANT = "tenant" - - -class SharingProfileGroupTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This property allows you to specify the type of sharing group. :code:`
`:code:`
` - Possible values are: :code:`
`:code:`
` **Subscriptions** :code:`
`:code:`
` - **AADTenants**. - """ - - SUBSCRIPTIONS = "Subscriptions" - AAD_TENANTS = "AADTenants" - - -class SharingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The sharing state of the gallery, which only appears in the response.""" - - SUCCEEDED = "Succeeded" - IN_PROGRESS = "InProgress" - FAILED = "Failed" - UNKNOWN = "Unknown" - - -class SharingUpdateOperationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This property allows you to specify the operation type of gallery sharing update. - :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Add** - :code:`
`:code:`
` **Remove** :code:`
`:code:`
` **Reset**. - """ - - ADD = "Add" - REMOVE = "Remove" - RESET = "Reset" - ENABLE_COMMUNITY = "EnableCommunity" - - -class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies the storage account type to be used to store the image. This property is not - updatable. - """ - - STANDARD_LRS = "Standard_LRS" - STANDARD_ZRS = "Standard_ZRS" - PREMIUM_LRS = "Premium_LRS" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_models_py3.py deleted file mode 100644 index 4914ea0f3cdb..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_models_py3.py +++ /dev/null @@ -1,4334 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Dict, List, Optional, TYPE_CHECKING, Union - -from ... import _serialization - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models - - -class ApiError(_serialization.Model): - """Api error. - - :ivar details: The Api error details. - :vartype details: list[~azure.mgmt.compute.v2022_03_03.models.ApiErrorBase] - :ivar innererror: The Api inner error. - :vartype innererror: ~azure.mgmt.compute.v2022_03_03.models.InnerError - :ivar code: The error code. - :vartype code: str - :ivar target: The target of the particular error. - :vartype target: str - :ivar message: The error message. - :vartype message: str - """ - - _attribute_map = { - "details": {"key": "details", "type": "[ApiErrorBase]"}, - "innererror": {"key": "innererror", "type": "InnerError"}, - "code": {"key": "code", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__( - self, - *, - details: Optional[List["_models.ApiErrorBase"]] = None, - innererror: Optional["_models.InnerError"] = None, - code: Optional[str] = None, - target: Optional[str] = None, - message: Optional[str] = None, - **kwargs - ): - """ - :keyword details: The Api error details. - :paramtype details: list[~azure.mgmt.compute.v2022_03_03.models.ApiErrorBase] - :keyword innererror: The Api inner error. - :paramtype innererror: ~azure.mgmt.compute.v2022_03_03.models.InnerError - :keyword code: The error code. - :paramtype code: str - :keyword target: The target of the particular error. - :paramtype target: str - :keyword message: The error message. - :paramtype message: str - """ - super().__init__(**kwargs) - self.details = details - self.innererror = innererror - self.code = code - self.target = target - self.message = message - - -class ApiErrorBase(_serialization.Model): - """Api error base. - - :ivar code: The error code. - :vartype code: str - :ivar target: The target of the particular error. - :vartype target: str - :ivar message: The error message. - :vartype message: str - """ - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__( - self, *, code: Optional[str] = None, target: Optional[str] = None, message: Optional[str] = None, **kwargs - ): - """ - :keyword code: The error code. - :paramtype code: str - :keyword target: The target of the particular error. - :paramtype target: str - :keyword message: The error message. - :paramtype message: str - """ - super().__init__(**kwargs) - self.code = code - self.target = target - self.message = message - - -class PirCommunityGalleryResource(_serialization.Model): - """Base information about the community gallery resource in pir. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - :ivar type: Resource type. - :vartype type: str - :ivar unique_id: The unique id of this community gallery. - :vartype unique_id: str - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "unique_id": {"key": "identifier.uniqueId", "type": "str"}, - } - - def __init__(self, *, unique_id: Optional[str] = None, **kwargs): - """ - :keyword unique_id: The unique id of this community gallery. - :paramtype unique_id: str - """ - super().__init__(**kwargs) - self.name = None - self.location = None - self.type = None - self.unique_id = unique_id - - -class CommunityGallery(PirCommunityGalleryResource): - """Specifies information about the Community Gallery that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - :ivar type: Resource type. - :vartype type: str - :ivar unique_id: The unique id of this community gallery. - :vartype unique_id: str - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "unique_id": {"key": "identifier.uniqueId", "type": "str"}, - } - - def __init__(self, *, unique_id: Optional[str] = None, **kwargs): - """ - :keyword unique_id: The unique id of this community gallery. - :paramtype unique_id: str - """ - super().__init__(unique_id=unique_id, **kwargs) - - -class CommunityGalleryImage(PirCommunityGalleryResource): # pylint: disable=too-many-instance-attributes - """Specifies information about the gallery image definition that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - :ivar type: Resource type. - :vartype type: str - :ivar unique_id: The unique id of this community gallery. - :vartype unique_id: str - :ivar os_type: This property allows you to specify the type of the OS that is included in the - disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :ivar os_state: This property allows the user to specify whether the virtual machines created - under this image are 'Generalized' or 'Specialized'. Known values are: "Generalized" and - "Specialized". - :vartype os_state: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemStateTypes - :ivar end_of_life_date: The end of life date of the gallery image definition. This property can - be used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar identifier: This is the gallery image definition identifier. - :vartype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageIdentifier - :ivar recommended: The properties describe the recommended machine configuration for this Image - Definition. These properties are updatable. - :vartype recommended: ~azure.mgmt.compute.v2022_03_03.models.RecommendedMachineConfiguration - :ivar disallowed: Describes the disallowed disk types. - :vartype disallowed: ~azure.mgmt.compute.v2022_03_03.models.Disallowed - :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :vartype hyper_v_generation: str or ~azure.mgmt.compute.v2022_03_03.models.HyperVGeneration - :ivar features: A list of gallery image features. - :vartype features: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImageFeature] - :ivar purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :vartype purchase_plan: ~azure.mgmt.compute.v2022_03_03.models.ImagePurchasePlan - :ivar architecture: The architecture of the image. Applicable to OS disks only. Known values - are: "x64" and "Arm64". - :vartype architecture: str or ~azure.mgmt.compute.v2022_03_03.models.Architecture - :ivar privacy_statement_uri: Privacy statement uri for the current community gallery image. - :vartype privacy_statement_uri: str - :ivar eula: End-user license agreement for the current community gallery image. - :vartype eula: str - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "unique_id": {"key": "identifier.uniqueId", "type": "str"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "os_state": {"key": "properties.osState", "type": "str"}, - "end_of_life_date": {"key": "properties.endOfLifeDate", "type": "iso-8601"}, - "identifier": {"key": "properties.identifier", "type": "GalleryImageIdentifier"}, - "recommended": {"key": "properties.recommended", "type": "RecommendedMachineConfiguration"}, - "disallowed": {"key": "properties.disallowed", "type": "Disallowed"}, - "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, - "features": {"key": "properties.features", "type": "[GalleryImageFeature]"}, - "purchase_plan": {"key": "properties.purchasePlan", "type": "ImagePurchasePlan"}, - "architecture": {"key": "properties.architecture", "type": "str"}, - "privacy_statement_uri": {"key": "properties.privacyStatementUri", "type": "str"}, - "eula": {"key": "properties.eula", "type": "str"}, - } - - def __init__( - self, - *, - unique_id: Optional[str] = None, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - os_state: Optional[Union[str, "_models.OperatingSystemStateTypes"]] = None, - end_of_life_date: Optional[datetime.datetime] = None, - identifier: Optional["_models.GalleryImageIdentifier"] = None, - recommended: Optional["_models.RecommendedMachineConfiguration"] = None, - disallowed: Optional["_models.Disallowed"] = None, - hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, - features: Optional[List["_models.GalleryImageFeature"]] = None, - purchase_plan: Optional["_models.ImagePurchasePlan"] = None, - architecture: Optional[Union[str, "_models.Architecture"]] = None, - privacy_statement_uri: Optional[str] = None, - eula: Optional[str] = None, - **kwargs - ): - """ - :keyword unique_id: The unique id of this community gallery. - :paramtype unique_id: str - :keyword os_type: This property allows you to specify the type of the OS that is included in - the disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :paramtype os_type: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :keyword os_state: This property allows the user to specify whether the virtual machines - created under this image are 'Generalized' or 'Specialized'. Known values are: "Generalized" - and "Specialized". - :paramtype os_state: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemStateTypes - :keyword end_of_life_date: The end of life date of the gallery image definition. This property - can be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword identifier: This is the gallery image definition identifier. - :paramtype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageIdentifier - :keyword recommended: The properties describe the recommended machine configuration for this - Image Definition. These properties are updatable. - :paramtype recommended: ~azure.mgmt.compute.v2022_03_03.models.RecommendedMachineConfiguration - :keyword disallowed: Describes the disallowed disk types. - :paramtype disallowed: ~azure.mgmt.compute.v2022_03_03.models.Disallowed - :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :paramtype hyper_v_generation: str or ~azure.mgmt.compute.v2022_03_03.models.HyperVGeneration - :keyword features: A list of gallery image features. - :paramtype features: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImageFeature] - :keyword purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :paramtype purchase_plan: ~azure.mgmt.compute.v2022_03_03.models.ImagePurchasePlan - :keyword architecture: The architecture of the image. Applicable to OS disks only. Known values - are: "x64" and "Arm64". - :paramtype architecture: str or ~azure.mgmt.compute.v2022_03_03.models.Architecture - :keyword privacy_statement_uri: Privacy statement uri for the current community gallery image. - :paramtype privacy_statement_uri: str - :keyword eula: End-user license agreement for the current community gallery image. - :paramtype eula: str - """ - super().__init__(unique_id=unique_id, **kwargs) - self.os_type = os_type - self.os_state = os_state - self.end_of_life_date = end_of_life_date - self.identifier = identifier - self.recommended = recommended - self.disallowed = disallowed - self.hyper_v_generation = hyper_v_generation - self.features = features - self.purchase_plan = purchase_plan - self.architecture = architecture - self.privacy_statement_uri = privacy_statement_uri - self.eula = eula - - -class CommunityGalleryImageList(_serialization.Model): - """The List Community Gallery Images operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of community gallery images. Required. - :vartype value: list[~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImage] - :ivar next_link: The uri to fetch the next page of community gallery images. Call ListNext() - with this to fetch the next page of community gallery images. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[CommunityGalleryImage]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.CommunityGalleryImage"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of community gallery images. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImage] - :keyword next_link: The uri to fetch the next page of community gallery images. Call ListNext() - with this to fetch the next page of community gallery images. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class CommunityGalleryImageVersion(PirCommunityGalleryResource): - """Specifies information about the gallery image version that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - :ivar type: Resource type. - :vartype type: str - :ivar unique_id: The unique id of this community gallery. - :vartype unique_id: str - :ivar published_date: The published date of the gallery image version Definition. This property - can be used for decommissioning purposes. This property is updatable. - :vartype published_date: ~datetime.datetime - :ivar end_of_life_date: The end of life date of the gallery image version Definition. This - property can be used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar exclude_from_latest: If set to true, Virtual Machines deployed from the latest version of - the Image Definition won't use this Image Version. - :vartype exclude_from_latest: bool - :ivar storage_profile: Describes the storage profile of the image version. - :vartype storage_profile: - ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImageVersionStorageProfile - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "unique_id": {"key": "identifier.uniqueId", "type": "str"}, - "published_date": {"key": "properties.publishedDate", "type": "iso-8601"}, - "end_of_life_date": {"key": "properties.endOfLifeDate", "type": "iso-8601"}, - "exclude_from_latest": {"key": "properties.excludeFromLatest", "type": "bool"}, - "storage_profile": {"key": "properties.storageProfile", "type": "SharedGalleryImageVersionStorageProfile"}, - } - - def __init__( - self, - *, - unique_id: Optional[str] = None, - published_date: Optional[datetime.datetime] = None, - end_of_life_date: Optional[datetime.datetime] = None, - exclude_from_latest: Optional[bool] = None, - storage_profile: Optional["_models.SharedGalleryImageVersionStorageProfile"] = None, - **kwargs - ): - """ - :keyword unique_id: The unique id of this community gallery. - :paramtype unique_id: str - :keyword published_date: The published date of the gallery image version Definition. This - property can be used for decommissioning purposes. This property is updatable. - :paramtype published_date: ~datetime.datetime - :keyword end_of_life_date: The end of life date of the gallery image version Definition. This - property can be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :paramtype exclude_from_latest: bool - :keyword storage_profile: Describes the storage profile of the image version. - :paramtype storage_profile: - ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImageVersionStorageProfile - """ - super().__init__(unique_id=unique_id, **kwargs) - self.published_date = published_date - self.end_of_life_date = end_of_life_date - self.exclude_from_latest = exclude_from_latest - self.storage_profile = storage_profile - - -class CommunityGalleryImageVersionList(_serialization.Model): - """The List Community Gallery Image versions operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of community gallery image versions. Required. - :vartype value: list[~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImageVersion] - :ivar next_link: The uri to fetch the next page of community gallery image versions. Call - ListNext() with this to fetch the next page of community gallery image versions. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[CommunityGalleryImageVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.CommunityGalleryImageVersion"], next_link: Optional[str] = None, **kwargs - ): - """ - :keyword value: A list of community gallery image versions. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImageVersion] - :keyword next_link: The uri to fetch the next page of community gallery image versions. Call - ListNext() with this to fetch the next page of community gallery image versions. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class CommunityGalleryInfo(_serialization.Model): - """Information of community gallery if current gallery is shared to community. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar publisher_uri: The link to the publisher website. Visible to all users. - :vartype publisher_uri: str - :ivar publisher_contact: Community gallery publisher support email. The email address of the - publisher. Visible to all users. - :vartype publisher_contact: str - :ivar eula: End-user license agreement for community gallery image. - :vartype eula: str - :ivar public_name_prefix: The prefix of the gallery name that will be displayed publicly. - Visible to all users. - :vartype public_name_prefix: str - :ivar community_gallery_enabled: Contains info about whether community gallery sharing is - enabled. - :vartype community_gallery_enabled: bool - :ivar public_names: Community gallery public name list. - :vartype public_names: list[str] - """ - - _validation = { - "community_gallery_enabled": {"readonly": True}, - "public_names": {"readonly": True}, - } - - _attribute_map = { - "publisher_uri": {"key": "publisherUri", "type": "str"}, - "publisher_contact": {"key": "publisherContact", "type": "str"}, - "eula": {"key": "eula", "type": "str"}, - "public_name_prefix": {"key": "publicNamePrefix", "type": "str"}, - "community_gallery_enabled": {"key": "communityGalleryEnabled", "type": "bool"}, - "public_names": {"key": "publicNames", "type": "[str]"}, - } - - def __init__( - self, - *, - publisher_uri: Optional[str] = None, - publisher_contact: Optional[str] = None, - eula: Optional[str] = None, - public_name_prefix: Optional[str] = None, - **kwargs - ): - """ - :keyword publisher_uri: The link to the publisher website. Visible to all users. - :paramtype publisher_uri: str - :keyword publisher_contact: Community gallery publisher support email. The email address of the - publisher. Visible to all users. - :paramtype publisher_contact: str - :keyword eula: End-user license agreement for community gallery image. - :paramtype eula: str - :keyword public_name_prefix: The prefix of the gallery name that will be displayed publicly. - Visible to all users. - :paramtype public_name_prefix: str - """ - super().__init__(**kwargs) - self.publisher_uri = publisher_uri - self.publisher_contact = publisher_contact - self.eula = eula - self.public_name_prefix = public_name_prefix - self.community_gallery_enabled = None - self.public_names = None - - -class DiskImageEncryption(_serialization.Model): - """This is the disk image encryption base class. - - :ivar disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption - set. - :vartype disk_encryption_set_id: str - """ - - _attribute_map = { - "disk_encryption_set_id": {"key": "diskEncryptionSetId", "type": "str"}, - } - - def __init__(self, *, disk_encryption_set_id: Optional[str] = None, **kwargs): - """ - :keyword disk_encryption_set_id: A relative URI containing the resource ID of the disk - encryption set. - :paramtype disk_encryption_set_id: str - """ - super().__init__(**kwargs) - self.disk_encryption_set_id = disk_encryption_set_id - - -class DataDiskImageEncryption(DiskImageEncryption): - """Contains encryption settings for a data disk image. - - All required parameters must be populated in order to send to Azure. - - :ivar disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption - set. - :vartype disk_encryption_set_id: str - :ivar lun: This property specifies the logical unit number of the data disk. This value is used - to identify data disks within the Virtual Machine and therefore must be unique for each data - disk attached to the Virtual Machine. Required. - :vartype lun: int - """ - - _validation = { - "lun": {"required": True}, - } - - _attribute_map = { - "disk_encryption_set_id": {"key": "diskEncryptionSetId", "type": "str"}, - "lun": {"key": "lun", "type": "int"}, - } - - def __init__(self, *, lun: int, disk_encryption_set_id: Optional[str] = None, **kwargs): - """ - :keyword disk_encryption_set_id: A relative URI containing the resource ID of the disk - encryption set. - :paramtype disk_encryption_set_id: str - :keyword lun: This property specifies the logical unit number of the data disk. This value is - used to identify data disks within the Virtual Machine and therefore must be unique for each - data disk attached to the Virtual Machine. Required. - :paramtype lun: int - """ - super().__init__(disk_encryption_set_id=disk_encryption_set_id, **kwargs) - self.lun = lun - - -class Disallowed(_serialization.Model): - """Describes the disallowed disk types. - - :ivar disk_types: A list of disk types. - :vartype disk_types: list[str] - """ - - _attribute_map = { - "disk_types": {"key": "diskTypes", "type": "[str]"}, - } - - def __init__(self, *, disk_types: Optional[List[str]] = None, **kwargs): - """ - :keyword disk_types: A list of disk types. - :paramtype disk_types: list[str] - """ - super().__init__(**kwargs) - self.disk_types = disk_types - - -class EncryptionImages(_serialization.Model): - """Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - - :ivar os_disk_image: Contains encryption settings for an OS disk image. - :vartype os_disk_image: ~azure.mgmt.compute.v2022_03_03.models.OSDiskImageEncryption - :ivar data_disk_images: A list of encryption specifications for data disk images. - :vartype data_disk_images: list[~azure.mgmt.compute.v2022_03_03.models.DataDiskImageEncryption] - """ - - _attribute_map = { - "os_disk_image": {"key": "osDiskImage", "type": "OSDiskImageEncryption"}, - "data_disk_images": {"key": "dataDiskImages", "type": "[DataDiskImageEncryption]"}, - } - - def __init__( - self, - *, - os_disk_image: Optional["_models.OSDiskImageEncryption"] = None, - data_disk_images: Optional[List["_models.DataDiskImageEncryption"]] = None, - **kwargs - ): - """ - :keyword os_disk_image: Contains encryption settings for an OS disk image. - :paramtype os_disk_image: ~azure.mgmt.compute.v2022_03_03.models.OSDiskImageEncryption - :keyword data_disk_images: A list of encryption specifications for data disk images. - :paramtype data_disk_images: - list[~azure.mgmt.compute.v2022_03_03.models.DataDiskImageEncryption] - """ - super().__init__(**kwargs) - self.os_disk_image = os_disk_image - self.data_disk_images = data_disk_images - - -class Resource(_serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - - -class Gallery(Resource): # pylint: disable=too-many-instance-attributes - """Specifies information about the Shared Image Gallery that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar description: The description of this Shared Image Gallery resource. This property is - updatable. - :vartype description: str - :ivar identifier: Describes the gallery unique name. - :vartype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryIdentifier - :ivar provisioning_state: The provisioning state, which only appears in the response. Known - values are: "Creating", "Updating", "Failed", "Succeeded", "Deleting", and "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2022_03_03.models.GalleryProvisioningState - :ivar sharing_profile: Profile for gallery sharing to subscription or tenant. - :vartype sharing_profile: ~azure.mgmt.compute.v2022_03_03.models.SharingProfile - :ivar soft_delete_policy: Contains information about the soft deletion policy of the gallery. - :vartype soft_delete_policy: ~azure.mgmt.compute.v2022_03_03.models.SoftDeletePolicy - :ivar sharing_status: Sharing status of current gallery. - :vartype sharing_status: ~azure.mgmt.compute.v2022_03_03.models.SharingStatus - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "provisioning_state": {"readonly": True}, - "sharing_status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "description": {"key": "properties.description", "type": "str"}, - "identifier": {"key": "properties.identifier", "type": "GalleryIdentifier"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "sharing_profile": {"key": "properties.sharingProfile", "type": "SharingProfile"}, - "soft_delete_policy": {"key": "properties.softDeletePolicy", "type": "SoftDeletePolicy"}, - "sharing_status": {"key": "properties.sharingStatus", "type": "SharingStatus"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - identifier: Optional["_models.GalleryIdentifier"] = None, - sharing_profile: Optional["_models.SharingProfile"] = None, - soft_delete_policy: Optional["_models.SoftDeletePolicy"] = None, - **kwargs - ): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword description: The description of this Shared Image Gallery resource. This property is - updatable. - :paramtype description: str - :keyword identifier: Describes the gallery unique name. - :paramtype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryIdentifier - :keyword sharing_profile: Profile for gallery sharing to subscription or tenant. - :paramtype sharing_profile: ~azure.mgmt.compute.v2022_03_03.models.SharingProfile - :keyword soft_delete_policy: Contains information about the soft deletion policy of the - gallery. - :paramtype soft_delete_policy: ~azure.mgmt.compute.v2022_03_03.models.SoftDeletePolicy - """ - super().__init__(location=location, tags=tags, **kwargs) - self.description = description - self.identifier = identifier - self.provisioning_state = None - self.sharing_profile = sharing_profile - self.soft_delete_policy = soft_delete_policy - self.sharing_status = None - - -class GalleryApplication(Resource): # pylint: disable=too-many-instance-attributes - """Specifies information about the gallery Application Definition that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar description: The description of this gallery Application Definition resource. This - property is updatable. - :vartype description: str - :ivar eula: The Eula agreement for the gallery Application Definition. - :vartype eula: str - :ivar privacy_statement_uri: The privacy statement uri. - :vartype privacy_statement_uri: str - :ivar release_note_uri: The release note uri. - :vartype release_note_uri: str - :ivar end_of_life_date: The end of life date of the gallery Application Definition. This - property can be used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar supported_os_type: This property allows you to specify the supported type of the OS that - application is built for. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :vartype supported_os_type: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :ivar custom_actions: A list of custom actions that can be performed with all of the Gallery - Application Versions within this Gallery Application. - :vartype custom_actions: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationCustomAction] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "description": {"key": "properties.description", "type": "str"}, - "eula": {"key": "properties.eula", "type": "str"}, - "privacy_statement_uri": {"key": "properties.privacyStatementUri", "type": "str"}, - "release_note_uri": {"key": "properties.releaseNoteUri", "type": "str"}, - "end_of_life_date": {"key": "properties.endOfLifeDate", "type": "iso-8601"}, - "supported_os_type": {"key": "properties.supportedOSType", "type": "str"}, - "custom_actions": {"key": "properties.customActions", "type": "[GalleryApplicationCustomAction]"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - eula: Optional[str] = None, - privacy_statement_uri: Optional[str] = None, - release_note_uri: Optional[str] = None, - end_of_life_date: Optional[datetime.datetime] = None, - supported_os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - custom_actions: Optional[List["_models.GalleryApplicationCustomAction"]] = None, - **kwargs - ): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword description: The description of this gallery Application Definition resource. This - property is updatable. - :paramtype description: str - :keyword eula: The Eula agreement for the gallery Application Definition. - :paramtype eula: str - :keyword privacy_statement_uri: The privacy statement uri. - :paramtype privacy_statement_uri: str - :keyword release_note_uri: The release note uri. - :paramtype release_note_uri: str - :keyword end_of_life_date: The end of life date of the gallery Application Definition. This - property can be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword supported_os_type: This property allows you to specify the supported type of the OS - that application is built for. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :paramtype supported_os_type: str or - ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :keyword custom_actions: A list of custom actions that can be performed with all of the Gallery - Application Versions within this Gallery Application. - :paramtype custom_actions: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationCustomAction] - """ - super().__init__(location=location, tags=tags, **kwargs) - self.description = description - self.eula = eula - self.privacy_statement_uri = privacy_statement_uri - self.release_note_uri = release_note_uri - self.end_of_life_date = end_of_life_date - self.supported_os_type = supported_os_type - self.custom_actions = custom_actions - - -class GalleryApplicationCustomAction(_serialization.Model): - """A custom action that can be performed with a Gallery Application Version. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the custom action. Must be unique within the Gallery Application - Version. Required. - :vartype name: str - :ivar script: The script to run when executing this custom action. Required. - :vartype script: str - :ivar description: Description to help the users understand what this custom action does. - :vartype description: str - :ivar parameters: The parameters that this custom action uses. - :vartype parameters: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationCustomActionParameter] - """ - - _validation = { - "name": {"required": True}, - "script": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "script": {"key": "script", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "parameters": {"key": "parameters", "type": "[GalleryApplicationCustomActionParameter]"}, - } - - def __init__( - self, - *, - name: str, - script: str, - description: Optional[str] = None, - parameters: Optional[List["_models.GalleryApplicationCustomActionParameter"]] = None, - **kwargs - ): - """ - :keyword name: The name of the custom action. Must be unique within the Gallery Application - Version. Required. - :paramtype name: str - :keyword script: The script to run when executing this custom action. Required. - :paramtype script: str - :keyword description: Description to help the users understand what this custom action does. - :paramtype description: str - :keyword parameters: The parameters that this custom action uses. - :paramtype parameters: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationCustomActionParameter] - """ - super().__init__(**kwargs) - self.name = name - self.script = script - self.description = description - self.parameters = parameters - - -class GalleryApplicationCustomActionParameter(_serialization.Model): - """The definition of a parameter that can be passed to a custom action of a Gallery Application Version. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the custom action. Must be unique within the Gallery Application - Version. Required. - :vartype name: str - :ivar required: Indicates whether this parameter must be passed when running the custom action. - :vartype required: bool - :ivar type: Specifies the type of the custom action parameter. Possible values are: String, - ConfigurationDataBlob or LogOutputBlob. Known values are: "String", "ConfigurationDataBlob", - and "LogOutputBlob". - :vartype type: str or - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationCustomActionParameterType - :ivar default_value: The default value of the parameter. Only applies to string types. - :vartype default_value: str - :ivar description: A description to help users understand what this parameter means. - :vartype description: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "required": {"key": "required", "type": "bool"}, - "type": {"key": "type", "type": "str"}, - "default_value": {"key": "defaultValue", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__( - self, - *, - name: str, - required: Optional[bool] = None, - type: Optional[Union[str, "_models.GalleryApplicationCustomActionParameterType"]] = None, - default_value: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword name: The name of the custom action. Must be unique within the Gallery Application - Version. Required. - :paramtype name: str - :keyword required: Indicates whether this parameter must be passed when running the custom - action. - :paramtype required: bool - :keyword type: Specifies the type of the custom action parameter. Possible values are: String, - ConfigurationDataBlob or LogOutputBlob. Known values are: "String", "ConfigurationDataBlob", - and "LogOutputBlob". - :paramtype type: str or - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationCustomActionParameterType - :keyword default_value: The default value of the parameter. Only applies to string types. - :paramtype default_value: str - :keyword description: A description to help users understand what this parameter means. - :paramtype description: str - """ - super().__init__(**kwargs) - self.name = name - self.required = required - self.type = type - self.default_value = default_value - self.description = description - - -class GalleryApplicationList(_serialization.Model): - """The List Gallery Applications operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of Gallery Applications. Required. - :vartype value: list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :ivar next_link: The uri to fetch the next page of Application Definitions in the Application - Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[GalleryApplication]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.GalleryApplication"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of Gallery Applications. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :keyword next_link: The uri to fetch the next page of Application Definitions in the - Application Gallery. Call ListNext() with this to fetch the next page of gallery Application - Definitions. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class UpdateResourceDefinition(_serialization.Model): - """The Update Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = tags - - -class GalleryApplicationUpdate(UpdateResourceDefinition): # pylint: disable=too-many-instance-attributes - """Specifies information about the gallery Application Definition that you want to update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar description: The description of this gallery Application Definition resource. This - property is updatable. - :vartype description: str - :ivar eula: The Eula agreement for the gallery Application Definition. - :vartype eula: str - :ivar privacy_statement_uri: The privacy statement uri. - :vartype privacy_statement_uri: str - :ivar release_note_uri: The release note uri. - :vartype release_note_uri: str - :ivar end_of_life_date: The end of life date of the gallery Application Definition. This - property can be used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar supported_os_type: This property allows you to specify the supported type of the OS that - application is built for. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :vartype supported_os_type: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :ivar custom_actions: A list of custom actions that can be performed with all of the Gallery - Application Versions within this Gallery Application. - :vartype custom_actions: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationCustomAction] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "description": {"key": "properties.description", "type": "str"}, - "eula": {"key": "properties.eula", "type": "str"}, - "privacy_statement_uri": {"key": "properties.privacyStatementUri", "type": "str"}, - "release_note_uri": {"key": "properties.releaseNoteUri", "type": "str"}, - "end_of_life_date": {"key": "properties.endOfLifeDate", "type": "iso-8601"}, - "supported_os_type": {"key": "properties.supportedOSType", "type": "str"}, - "custom_actions": {"key": "properties.customActions", "type": "[GalleryApplicationCustomAction]"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - eula: Optional[str] = None, - privacy_statement_uri: Optional[str] = None, - release_note_uri: Optional[str] = None, - end_of_life_date: Optional[datetime.datetime] = None, - supported_os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - custom_actions: Optional[List["_models.GalleryApplicationCustomAction"]] = None, - **kwargs - ): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword description: The description of this gallery Application Definition resource. This - property is updatable. - :paramtype description: str - :keyword eula: The Eula agreement for the gallery Application Definition. - :paramtype eula: str - :keyword privacy_statement_uri: The privacy statement uri. - :paramtype privacy_statement_uri: str - :keyword release_note_uri: The release note uri. - :paramtype release_note_uri: str - :keyword end_of_life_date: The end of life date of the gallery Application Definition. This - property can be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword supported_os_type: This property allows you to specify the supported type of the OS - that application is built for. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :paramtype supported_os_type: str or - ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :keyword custom_actions: A list of custom actions that can be performed with all of the Gallery - Application Versions within this Gallery Application. - :paramtype custom_actions: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationCustomAction] - """ - super().__init__(tags=tags, **kwargs) - self.description = description - self.eula = eula - self.privacy_statement_uri = privacy_statement_uri - self.release_note_uri = release_note_uri - self.end_of_life_date = end_of_life_date - self.supported_os_type = supported_os_type - self.custom_actions = custom_actions - - -class GalleryApplicationVersion(Resource): - """Specifies information about the gallery Application Version that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar publishing_profile: The publishing profile of a gallery image version. - :vartype publishing_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionPublishingProfile - :ivar safety_profile: The safety profile of the Gallery Application Version. - :vartype safety_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionSafetyProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. Known - values are: "Creating", "Updating", "Failed", "Succeeded", "Deleting", and "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2022_03_03.models.GalleryProvisioningState - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2022_03_03.models.ReplicationStatus - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "provisioning_state": {"readonly": True}, - "replication_status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "publishing_profile": { - "key": "properties.publishingProfile", - "type": "GalleryApplicationVersionPublishingProfile", - }, - "safety_profile": {"key": "properties.safetyProfile", "type": "GalleryApplicationVersionSafetyProfile"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "replication_status": {"key": "properties.replicationStatus", "type": "ReplicationStatus"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - publishing_profile: Optional["_models.GalleryApplicationVersionPublishingProfile"] = None, - safety_profile: Optional["_models.GalleryApplicationVersionSafetyProfile"] = None, - **kwargs - ): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword publishing_profile: The publishing profile of a gallery image version. - :paramtype publishing_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionPublishingProfile - :keyword safety_profile: The safety profile of the Gallery Application Version. - :paramtype safety_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionSafetyProfile - """ - super().__init__(location=location, tags=tags, **kwargs) - self.publishing_profile = publishing_profile - self.safety_profile = safety_profile - self.provisioning_state = None - self.replication_status = None - - -class GalleryApplicationVersionList(_serialization.Model): - """The List Gallery Application version operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of gallery Application Versions. Required. - :vartype value: list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :ivar next_link: The uri to fetch the next page of gallery Application Versions. Call - ListNext() with this to fetch the next page of gallery Application Versions. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[GalleryApplicationVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.GalleryApplicationVersion"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of gallery Application Versions. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :keyword next_link: The uri to fetch the next page of gallery Application Versions. Call - ListNext() with this to fetch the next page of gallery Application Versions. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class GalleryArtifactPublishingProfileBase(_serialization.Model): - """Describes the basic gallery artifact publishing profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar target_regions: The target regions where the Image Version is going to be replicated to. - This property is updatable. - :vartype target_regions: list[~azure.mgmt.compute.v2022_03_03.models.TargetRegion] - :ivar replica_count: The number of replicas of the Image Version to be created per region. This - property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :vartype replica_count: int - :ivar exclude_from_latest: If set to true, Virtual Machines deployed from the latest version of - the Image Definition won't use this Image Version. - :vartype exclude_from_latest: bool - :ivar published_date: The timestamp for when the gallery image version is published. - :vartype published_date: ~datetime.datetime - :ivar end_of_life_date: The end of life date of the gallery image version. This property can be - used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Known values are: "Standard_LRS", "Standard_ZRS", and - "Premium_LRS". - :vartype storage_account_type: str or ~azure.mgmt.compute.v2022_03_03.models.StorageAccountType - :ivar replication_mode: Optional parameter which specifies the mode to be used for replication. - This property is not updatable. Known values are: "Full" and "Shallow". - :vartype replication_mode: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationMode - :ivar target_extended_locations: The target extended locations where the Image Version is going - to be replicated to. This property is updatable. - :vartype target_extended_locations: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryTargetExtendedLocation] - """ - - _validation = { - "published_date": {"readonly": True}, - } - - _attribute_map = { - "target_regions": {"key": "targetRegions", "type": "[TargetRegion]"}, - "replica_count": {"key": "replicaCount", "type": "int"}, - "exclude_from_latest": {"key": "excludeFromLatest", "type": "bool"}, - "published_date": {"key": "publishedDate", "type": "iso-8601"}, - "end_of_life_date": {"key": "endOfLifeDate", "type": "iso-8601"}, - "storage_account_type": {"key": "storageAccountType", "type": "str"}, - "replication_mode": {"key": "replicationMode", "type": "str"}, - "target_extended_locations": {"key": "targetExtendedLocations", "type": "[GalleryTargetExtendedLocation]"}, - } - - def __init__( - self, - *, - target_regions: Optional[List["_models.TargetRegion"]] = None, - replica_count: Optional[int] = None, - exclude_from_latest: Optional[bool] = None, - end_of_life_date: Optional[datetime.datetime] = None, - storage_account_type: Optional[Union[str, "_models.StorageAccountType"]] = None, - replication_mode: Optional[Union[str, "_models.ReplicationMode"]] = None, - target_extended_locations: Optional[List["_models.GalleryTargetExtendedLocation"]] = None, - **kwargs - ): - """ - :keyword target_regions: The target regions where the Image Version is going to be replicated - to. This property is updatable. - :paramtype target_regions: list[~azure.mgmt.compute.v2022_03_03.models.TargetRegion] - :keyword replica_count: The number of replicas of the Image Version to be created per region. - This property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :paramtype replica_count: int - :keyword exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :paramtype exclude_from_latest: bool - :keyword end_of_life_date: The end of life date of the gallery image version. This property can - be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword storage_account_type: Specifies the storage account type to be used to store the - image. This property is not updatable. Known values are: "Standard_LRS", "Standard_ZRS", and - "Premium_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.compute.v2022_03_03.models.StorageAccountType - :keyword replication_mode: Optional parameter which specifies the mode to be used for - replication. This property is not updatable. Known values are: "Full" and "Shallow". - :paramtype replication_mode: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationMode - :keyword target_extended_locations: The target extended locations where the Image Version is - going to be replicated to. This property is updatable. - :paramtype target_extended_locations: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryTargetExtendedLocation] - """ - super().__init__(**kwargs) - self.target_regions = target_regions - self.replica_count = replica_count - self.exclude_from_latest = exclude_from_latest - self.published_date = None - self.end_of_life_date = end_of_life_date - self.storage_account_type = storage_account_type - self.replication_mode = replication_mode - self.target_extended_locations = target_extended_locations - - -class GalleryApplicationVersionPublishingProfile( - GalleryArtifactPublishingProfileBase -): # pylint: disable=too-many-instance-attributes - """The publishing profile of a gallery image version. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar target_regions: The target regions where the Image Version is going to be replicated to. - This property is updatable. - :vartype target_regions: list[~azure.mgmt.compute.v2022_03_03.models.TargetRegion] - :ivar replica_count: The number of replicas of the Image Version to be created per region. This - property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :vartype replica_count: int - :ivar exclude_from_latest: If set to true, Virtual Machines deployed from the latest version of - the Image Definition won't use this Image Version. - :vartype exclude_from_latest: bool - :ivar published_date: The timestamp for when the gallery image version is published. - :vartype published_date: ~datetime.datetime - :ivar end_of_life_date: The end of life date of the gallery image version. This property can be - used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Known values are: "Standard_LRS", "Standard_ZRS", and - "Premium_LRS". - :vartype storage_account_type: str or ~azure.mgmt.compute.v2022_03_03.models.StorageAccountType - :ivar replication_mode: Optional parameter which specifies the mode to be used for replication. - This property is not updatable. Known values are: "Full" and "Shallow". - :vartype replication_mode: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationMode - :ivar target_extended_locations: The target extended locations where the Image Version is going - to be replicated to. This property is updatable. - :vartype target_extended_locations: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryTargetExtendedLocation] - :ivar source: The source image from which the Image Version is going to be created. Required. - :vartype source: ~azure.mgmt.compute.v2022_03_03.models.UserArtifactSource - :ivar manage_actions: - :vartype manage_actions: ~azure.mgmt.compute.v2022_03_03.models.UserArtifactManage - :ivar settings: Additional settings for the VM app that contains the target package and config - file name when it is deployed to target VM or VM scale set. - :vartype settings: ~azure.mgmt.compute.v2022_03_03.models.UserArtifactSettings - :ivar advanced_settings: Optional. Additional settings to pass to the vm-application-manager - extension. For advanced use only. - :vartype advanced_settings: dict[str, str] - :ivar enable_health_check: Optional. Whether or not this application reports health. - :vartype enable_health_check: bool - :ivar custom_actions: A list of custom actions that can be performed with this Gallery - Application Version. - :vartype custom_actions: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationCustomAction] - """ - - _validation = { - "published_date": {"readonly": True}, - "source": {"required": True}, - } - - _attribute_map = { - "target_regions": {"key": "targetRegions", "type": "[TargetRegion]"}, - "replica_count": {"key": "replicaCount", "type": "int"}, - "exclude_from_latest": {"key": "excludeFromLatest", "type": "bool"}, - "published_date": {"key": "publishedDate", "type": "iso-8601"}, - "end_of_life_date": {"key": "endOfLifeDate", "type": "iso-8601"}, - "storage_account_type": {"key": "storageAccountType", "type": "str"}, - "replication_mode": {"key": "replicationMode", "type": "str"}, - "target_extended_locations": {"key": "targetExtendedLocations", "type": "[GalleryTargetExtendedLocation]"}, - "source": {"key": "source", "type": "UserArtifactSource"}, - "manage_actions": {"key": "manageActions", "type": "UserArtifactManage"}, - "settings": {"key": "settings", "type": "UserArtifactSettings"}, - "advanced_settings": {"key": "advancedSettings", "type": "{str}"}, - "enable_health_check": {"key": "enableHealthCheck", "type": "bool"}, - "custom_actions": {"key": "customActions", "type": "[GalleryApplicationCustomAction]"}, - } - - def __init__( - self, - *, - source: "_models.UserArtifactSource", - target_regions: Optional[List["_models.TargetRegion"]] = None, - replica_count: Optional[int] = None, - exclude_from_latest: Optional[bool] = None, - end_of_life_date: Optional[datetime.datetime] = None, - storage_account_type: Optional[Union[str, "_models.StorageAccountType"]] = None, - replication_mode: Optional[Union[str, "_models.ReplicationMode"]] = None, - target_extended_locations: Optional[List["_models.GalleryTargetExtendedLocation"]] = None, - manage_actions: Optional["_models.UserArtifactManage"] = None, - settings: Optional["_models.UserArtifactSettings"] = None, - advanced_settings: Optional[Dict[str, str]] = None, - enable_health_check: Optional[bool] = None, - custom_actions: Optional[List["_models.GalleryApplicationCustomAction"]] = None, - **kwargs - ): - """ - :keyword target_regions: The target regions where the Image Version is going to be replicated - to. This property is updatable. - :paramtype target_regions: list[~azure.mgmt.compute.v2022_03_03.models.TargetRegion] - :keyword replica_count: The number of replicas of the Image Version to be created per region. - This property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :paramtype replica_count: int - :keyword exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :paramtype exclude_from_latest: bool - :keyword end_of_life_date: The end of life date of the gallery image version. This property can - be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword storage_account_type: Specifies the storage account type to be used to store the - image. This property is not updatable. Known values are: "Standard_LRS", "Standard_ZRS", and - "Premium_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.compute.v2022_03_03.models.StorageAccountType - :keyword replication_mode: Optional parameter which specifies the mode to be used for - replication. This property is not updatable. Known values are: "Full" and "Shallow". - :paramtype replication_mode: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationMode - :keyword target_extended_locations: The target extended locations where the Image Version is - going to be replicated to. This property is updatable. - :paramtype target_extended_locations: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryTargetExtendedLocation] - :keyword source: The source image from which the Image Version is going to be created. - Required. - :paramtype source: ~azure.mgmt.compute.v2022_03_03.models.UserArtifactSource - :keyword manage_actions: - :paramtype manage_actions: ~azure.mgmt.compute.v2022_03_03.models.UserArtifactManage - :keyword settings: Additional settings for the VM app that contains the target package and - config file name when it is deployed to target VM or VM scale set. - :paramtype settings: ~azure.mgmt.compute.v2022_03_03.models.UserArtifactSettings - :keyword advanced_settings: Optional. Additional settings to pass to the vm-application-manager - extension. For advanced use only. - :paramtype advanced_settings: dict[str, str] - :keyword enable_health_check: Optional. Whether or not this application reports health. - :paramtype enable_health_check: bool - :keyword custom_actions: A list of custom actions that can be performed with this Gallery - Application Version. - :paramtype custom_actions: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationCustomAction] - """ - super().__init__( - target_regions=target_regions, - replica_count=replica_count, - exclude_from_latest=exclude_from_latest, - end_of_life_date=end_of_life_date, - storage_account_type=storage_account_type, - replication_mode=replication_mode, - target_extended_locations=target_extended_locations, - **kwargs - ) - self.source = source - self.manage_actions = manage_actions - self.settings = settings - self.advanced_settings = advanced_settings - self.enable_health_check = enable_health_check - self.custom_actions = custom_actions - - -class GalleryArtifactSafetyProfileBase(_serialization.Model): - """This is the safety profile of the Gallery Artifact Version. - - :ivar allow_deletion_of_replicated_locations: Indicates whether or not removing this Gallery - Image Version from replicated regions is allowed. - :vartype allow_deletion_of_replicated_locations: bool - """ - - _attribute_map = { - "allow_deletion_of_replicated_locations": {"key": "allowDeletionOfReplicatedLocations", "type": "bool"}, - } - - def __init__(self, *, allow_deletion_of_replicated_locations: Optional[bool] = None, **kwargs): - """ - :keyword allow_deletion_of_replicated_locations: Indicates whether or not removing this Gallery - Image Version from replicated regions is allowed. - :paramtype allow_deletion_of_replicated_locations: bool - """ - super().__init__(**kwargs) - self.allow_deletion_of_replicated_locations = allow_deletion_of_replicated_locations - - -class GalleryApplicationVersionSafetyProfile(GalleryArtifactSafetyProfileBase): - """The safety profile of the Gallery Application Version. - - :ivar allow_deletion_of_replicated_locations: Indicates whether or not removing this Gallery - Image Version from replicated regions is allowed. - :vartype allow_deletion_of_replicated_locations: bool - """ - - _attribute_map = { - "allow_deletion_of_replicated_locations": {"key": "allowDeletionOfReplicatedLocations", "type": "bool"}, - } - - def __init__(self, *, allow_deletion_of_replicated_locations: Optional[bool] = None, **kwargs): - """ - :keyword allow_deletion_of_replicated_locations: Indicates whether or not removing this Gallery - Image Version from replicated regions is allowed. - :paramtype allow_deletion_of_replicated_locations: bool - """ - super().__init__(allow_deletion_of_replicated_locations=allow_deletion_of_replicated_locations, **kwargs) - - -class GalleryApplicationVersionUpdate(UpdateResourceDefinition): - """Specifies information about the gallery Application Version that you want to update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar publishing_profile: The publishing profile of a gallery image version. - :vartype publishing_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionPublishingProfile - :ivar safety_profile: The safety profile of the Gallery Application Version. - :vartype safety_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionSafetyProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. Known - values are: "Creating", "Updating", "Failed", "Succeeded", "Deleting", and "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2022_03_03.models.GalleryProvisioningState - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2022_03_03.models.ReplicationStatus - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "replication_status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "publishing_profile": { - "key": "properties.publishingProfile", - "type": "GalleryApplicationVersionPublishingProfile", - }, - "safety_profile": {"key": "properties.safetyProfile", "type": "GalleryApplicationVersionSafetyProfile"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "replication_status": {"key": "properties.replicationStatus", "type": "ReplicationStatus"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - publishing_profile: Optional["_models.GalleryApplicationVersionPublishingProfile"] = None, - safety_profile: Optional["_models.GalleryApplicationVersionSafetyProfile"] = None, - **kwargs - ): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword publishing_profile: The publishing profile of a gallery image version. - :paramtype publishing_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionPublishingProfile - :keyword safety_profile: The safety profile of the Gallery Application Version. - :paramtype safety_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionSafetyProfile - """ - super().__init__(tags=tags, **kwargs) - self.publishing_profile = publishing_profile - self.safety_profile = safety_profile - self.provisioning_state = None - self.replication_status = None - - -class GalleryArtifactSource(_serialization.Model): - """The source image from which the Image Version is going to be created. - - All required parameters must be populated in order to send to Azure. - - :ivar managed_image: The managed artifact. Required. - :vartype managed_image: ~azure.mgmt.compute.v2022_03_03.models.ManagedArtifact - """ - - _validation = { - "managed_image": {"required": True}, - } - - _attribute_map = { - "managed_image": {"key": "managedImage", "type": "ManagedArtifact"}, - } - - def __init__(self, *, managed_image: "_models.ManagedArtifact", **kwargs): - """ - :keyword managed_image: The managed artifact. Required. - :paramtype managed_image: ~azure.mgmt.compute.v2022_03_03.models.ManagedArtifact - """ - super().__init__(**kwargs) - self.managed_image = managed_image - - -class GalleryArtifactVersionSource(_serialization.Model): - """The gallery artifact version source. - - :ivar id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, - user image or storage account resource. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin - """ - :keyword id: The id of the gallery artifact version source. Can specify a disk uri, snapshot - uri, user image or storage account resource. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class GalleryArtifactVersionFullSource(GalleryArtifactVersionSource): - """The source of the gallery artifact version. - - :ivar id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, - user image or storage account resource. - :vartype id: str - :ivar community_gallery_image_id: The resource Id of the source Community Gallery Image. Only - required when using Community Gallery Image as a source. - :vartype community_gallery_image_id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "community_gallery_image_id": {"key": "communityGalleryImageId", "type": "str"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - community_gallery_image_id: Optional[str] = None, - **kwargs - ): - """ - :keyword id: The id of the gallery artifact version source. Can specify a disk uri, snapshot - uri, user image or storage account resource. - :paramtype id: str - :keyword community_gallery_image_id: The resource Id of the source Community Gallery Image. - Only required when using Community Gallery Image as a source. - :paramtype community_gallery_image_id: str - """ - super().__init__(id=id, **kwargs) - self.community_gallery_image_id = community_gallery_image_id - - -class GalleryDiskImage(_serialization.Model): - """This is the disk image base class. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar size_in_gb: This property indicates the size of the VHD to be created. - :vartype size_in_gb: int - :ivar host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :vartype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.HostCaching - :ivar source: The source for the disk image. - :vartype source: ~azure.mgmt.compute.v2022_03_03.models.GalleryDiskImageSource - """ - - _validation = { - "size_in_gb": {"readonly": True}, - } - - _attribute_map = { - "size_in_gb": {"key": "sizeInGB", "type": "int"}, - "host_caching": {"key": "hostCaching", "type": "str"}, - "source": {"key": "source", "type": "GalleryDiskImageSource"}, - } - - def __init__( - self, - *, - host_caching: Optional[Union[str, "_models.HostCaching"]] = None, - source: Optional["_models.GalleryDiskImageSource"] = None, - **kwargs - ): - """ - :keyword host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :paramtype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.HostCaching - :keyword source: The source for the disk image. - :paramtype source: ~azure.mgmt.compute.v2022_03_03.models.GalleryDiskImageSource - """ - super().__init__(**kwargs) - self.size_in_gb = None - self.host_caching = host_caching - self.source = source - - -class GalleryDataDiskImage(GalleryDiskImage): - """This is the data disk image. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar size_in_gb: This property indicates the size of the VHD to be created. - :vartype size_in_gb: int - :ivar host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :vartype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.HostCaching - :ivar source: The source for the disk image. - :vartype source: ~azure.mgmt.compute.v2022_03_03.models.GalleryDiskImageSource - :ivar lun: This property specifies the logical unit number of the data disk. This value is used - to identify data disks within the Virtual Machine and therefore must be unique for each data - disk attached to the Virtual Machine. Required. - :vartype lun: int - """ - - _validation = { - "size_in_gb": {"readonly": True}, - "lun": {"required": True}, - } - - _attribute_map = { - "size_in_gb": {"key": "sizeInGB", "type": "int"}, - "host_caching": {"key": "hostCaching", "type": "str"}, - "source": {"key": "source", "type": "GalleryDiskImageSource"}, - "lun": {"key": "lun", "type": "int"}, - } - - def __init__( - self, - *, - lun: int, - host_caching: Optional[Union[str, "_models.HostCaching"]] = None, - source: Optional["_models.GalleryDiskImageSource"] = None, - **kwargs - ): - """ - :keyword host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :paramtype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.HostCaching - :keyword source: The source for the disk image. - :paramtype source: ~azure.mgmt.compute.v2022_03_03.models.GalleryDiskImageSource - :keyword lun: This property specifies the logical unit number of the data disk. This value is - used to identify data disks within the Virtual Machine and therefore must be unique for each - data disk attached to the Virtual Machine. Required. - :paramtype lun: int - """ - super().__init__(host_caching=host_caching, source=source, **kwargs) - self.lun = lun - - -class GalleryDiskImageSource(GalleryArtifactVersionSource): - """The source for the disk image. - - :ivar id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, - user image or storage account resource. - :vartype id: str - :ivar uri: The uri of the gallery artifact version source. Currently used to specify vhd/blob - source. - :vartype uri: str - :ivar storage_account_id: The Storage Account Id that contains the vhd blob being used as a - source for this artifact version. - :vartype storage_account_id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "uri": {"key": "uri", "type": "str"}, - "storage_account_id": {"key": "storageAccountId", "type": "str"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - uri: Optional[str] = None, - storage_account_id: Optional[str] = None, - **kwargs - ): - """ - :keyword id: The id of the gallery artifact version source. Can specify a disk uri, snapshot - uri, user image or storage account resource. - :paramtype id: str - :keyword uri: The uri of the gallery artifact version source. Currently used to specify - vhd/blob source. - :paramtype uri: str - :keyword storage_account_id: The Storage Account Id that contains the vhd blob being used as a - source for this artifact version. - :paramtype storage_account_id: str - """ - super().__init__(id=id, **kwargs) - self.uri = uri - self.storage_account_id = storage_account_id - - -class GalleryExtendedLocation(_serialization.Model): - """The name of the extended location. - - :ivar name: - :vartype name: str - :ivar type: It is type of the extended location. Known values are: "EdgeZone" and "Unknown". - :vartype type: str or ~azure.mgmt.compute.v2022_03_03.models.GalleryExtendedLocationType - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - type: Optional[Union[str, "_models.GalleryExtendedLocationType"]] = None, - **kwargs - ): - """ - :keyword name: - :paramtype name: str - :keyword type: It is type of the extended location. Known values are: "EdgeZone" and "Unknown". - :paramtype type: str or ~azure.mgmt.compute.v2022_03_03.models.GalleryExtendedLocationType - """ - super().__init__(**kwargs) - self.name = name - self.type = type - - -class GalleryIdentifier(_serialization.Model): - """Describes the gallery unique name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar unique_name: The unique name of the Shared Image Gallery. This name is generated - automatically by Azure. - :vartype unique_name: str - """ - - _validation = { - "unique_name": {"readonly": True}, - } - - _attribute_map = { - "unique_name": {"key": "uniqueName", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.unique_name = None - - -class GalleryImage(Resource): # pylint: disable=too-many-instance-attributes - """Specifies information about the gallery image definition that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar description: The description of this gallery image definition resource. This property is - updatable. - :vartype description: str - :ivar eula: The Eula agreement for the gallery image definition. - :vartype eula: str - :ivar privacy_statement_uri: The privacy statement uri. - :vartype privacy_statement_uri: str - :ivar release_note_uri: The release note uri. - :vartype release_note_uri: str - :ivar os_type: This property allows you to specify the type of the OS that is included in the - disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :ivar os_state: This property allows the user to specify whether the virtual machines created - under this image are 'Generalized' or 'Specialized'. Known values are: "Generalized" and - "Specialized". - :vartype os_state: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemStateTypes - :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :vartype hyper_v_generation: str or ~azure.mgmt.compute.v2022_03_03.models.HyperVGeneration - :ivar end_of_life_date: The end of life date of the gallery image definition. This property can - be used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar identifier: This is the gallery image definition identifier. - :vartype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageIdentifier - :ivar recommended: The properties describe the recommended machine configuration for this Image - Definition. These properties are updatable. - :vartype recommended: ~azure.mgmt.compute.v2022_03_03.models.RecommendedMachineConfiguration - :ivar disallowed: Describes the disallowed disk types. - :vartype disallowed: ~azure.mgmt.compute.v2022_03_03.models.Disallowed - :ivar purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :vartype purchase_plan: ~azure.mgmt.compute.v2022_03_03.models.ImagePurchasePlan - :ivar provisioning_state: The provisioning state, which only appears in the response. Known - values are: "Creating", "Updating", "Failed", "Succeeded", "Deleting", and "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2022_03_03.models.GalleryProvisioningState - :ivar features: A list of gallery image features. - :vartype features: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImageFeature] - :ivar architecture: The architecture of the image. Applicable to OS disks only. Known values - are: "x64" and "Arm64". - :vartype architecture: str or ~azure.mgmt.compute.v2022_03_03.models.Architecture - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "description": {"key": "properties.description", "type": "str"}, - "eula": {"key": "properties.eula", "type": "str"}, - "privacy_statement_uri": {"key": "properties.privacyStatementUri", "type": "str"}, - "release_note_uri": {"key": "properties.releaseNoteUri", "type": "str"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "os_state": {"key": "properties.osState", "type": "str"}, - "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, - "end_of_life_date": {"key": "properties.endOfLifeDate", "type": "iso-8601"}, - "identifier": {"key": "properties.identifier", "type": "GalleryImageIdentifier"}, - "recommended": {"key": "properties.recommended", "type": "RecommendedMachineConfiguration"}, - "disallowed": {"key": "properties.disallowed", "type": "Disallowed"}, - "purchase_plan": {"key": "properties.purchasePlan", "type": "ImagePurchasePlan"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "features": {"key": "properties.features", "type": "[GalleryImageFeature]"}, - "architecture": {"key": "properties.architecture", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - eula: Optional[str] = None, - privacy_statement_uri: Optional[str] = None, - release_note_uri: Optional[str] = None, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - os_state: Optional[Union[str, "_models.OperatingSystemStateTypes"]] = None, - hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, - end_of_life_date: Optional[datetime.datetime] = None, - identifier: Optional["_models.GalleryImageIdentifier"] = None, - recommended: Optional["_models.RecommendedMachineConfiguration"] = None, - disallowed: Optional["_models.Disallowed"] = None, - purchase_plan: Optional["_models.ImagePurchasePlan"] = None, - features: Optional[List["_models.GalleryImageFeature"]] = None, - architecture: Optional[Union[str, "_models.Architecture"]] = None, - **kwargs - ): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword description: The description of this gallery image definition resource. This property - is updatable. - :paramtype description: str - :keyword eula: The Eula agreement for the gallery image definition. - :paramtype eula: str - :keyword privacy_statement_uri: The privacy statement uri. - :paramtype privacy_statement_uri: str - :keyword release_note_uri: The release note uri. - :paramtype release_note_uri: str - :keyword os_type: This property allows you to specify the type of the OS that is included in - the disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :paramtype os_type: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :keyword os_state: This property allows the user to specify whether the virtual machines - created under this image are 'Generalized' or 'Specialized'. Known values are: "Generalized" - and "Specialized". - :paramtype os_state: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemStateTypes - :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :paramtype hyper_v_generation: str or ~azure.mgmt.compute.v2022_03_03.models.HyperVGeneration - :keyword end_of_life_date: The end of life date of the gallery image definition. This property - can be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword identifier: This is the gallery image definition identifier. - :paramtype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageIdentifier - :keyword recommended: The properties describe the recommended machine configuration for this - Image Definition. These properties are updatable. - :paramtype recommended: ~azure.mgmt.compute.v2022_03_03.models.RecommendedMachineConfiguration - :keyword disallowed: Describes the disallowed disk types. - :paramtype disallowed: ~azure.mgmt.compute.v2022_03_03.models.Disallowed - :keyword purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :paramtype purchase_plan: ~azure.mgmt.compute.v2022_03_03.models.ImagePurchasePlan - :keyword features: A list of gallery image features. - :paramtype features: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImageFeature] - :keyword architecture: The architecture of the image. Applicable to OS disks only. Known values - are: "x64" and "Arm64". - :paramtype architecture: str or ~azure.mgmt.compute.v2022_03_03.models.Architecture - """ - super().__init__(location=location, tags=tags, **kwargs) - self.description = description - self.eula = eula - self.privacy_statement_uri = privacy_statement_uri - self.release_note_uri = release_note_uri - self.os_type = os_type - self.os_state = os_state - self.hyper_v_generation = hyper_v_generation - self.end_of_life_date = end_of_life_date - self.identifier = identifier - self.recommended = recommended - self.disallowed = disallowed - self.purchase_plan = purchase_plan - self.provisioning_state = None - self.features = features - self.architecture = architecture - - -class GalleryImageFeature(_serialization.Model): - """A feature for gallery image. - - :ivar name: The name of the gallery image feature. - :vartype name: str - :ivar value: The value of the gallery image feature. - :vartype value: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs): - """ - :keyword name: The name of the gallery image feature. - :paramtype name: str - :keyword value: The value of the gallery image feature. - :paramtype value: str - """ - super().__init__(**kwargs) - self.name = name - self.value = value - - -class GalleryImageIdentifier(_serialization.Model): - """This is the gallery image definition identifier. - - All required parameters must be populated in order to send to Azure. - - :ivar publisher: The name of the gallery image definition publisher. Required. - :vartype publisher: str - :ivar offer: The name of the gallery image definition offer. Required. - :vartype offer: str - :ivar sku: The name of the gallery image definition SKU. Required. - :vartype sku: str - """ - - _validation = { - "publisher": {"required": True}, - "offer": {"required": True}, - "sku": {"required": True}, - } - - _attribute_map = { - "publisher": {"key": "publisher", "type": "str"}, - "offer": {"key": "offer", "type": "str"}, - "sku": {"key": "sku", "type": "str"}, - } - - def __init__(self, *, publisher: str, offer: str, sku: str, **kwargs): - """ - :keyword publisher: The name of the gallery image definition publisher. Required. - :paramtype publisher: str - :keyword offer: The name of the gallery image definition offer. Required. - :paramtype offer: str - :keyword sku: The name of the gallery image definition SKU. Required. - :paramtype sku: str - """ - super().__init__(**kwargs) - self.publisher = publisher - self.offer = offer - self.sku = sku - - -class GalleryImageList(_serialization.Model): - """The List Gallery Images operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of Shared Image Gallery images. Required. - :vartype value: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :ivar next_link: The uri to fetch the next page of Image Definitions in the Shared Image - Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[GalleryImage]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.GalleryImage"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of Shared Image Gallery images. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :keyword next_link: The uri to fetch the next page of Image Definitions in the Shared Image - Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class GalleryImageUpdate(UpdateResourceDefinition): # pylint: disable=too-many-instance-attributes - """Specifies information about the gallery image definition that you want to update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar description: The description of this gallery image definition resource. This property is - updatable. - :vartype description: str - :ivar eula: The Eula agreement for the gallery image definition. - :vartype eula: str - :ivar privacy_statement_uri: The privacy statement uri. - :vartype privacy_statement_uri: str - :ivar release_note_uri: The release note uri. - :vartype release_note_uri: str - :ivar os_type: This property allows you to specify the type of the OS that is included in the - disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :ivar os_state: This property allows the user to specify whether the virtual machines created - under this image are 'Generalized' or 'Specialized'. Known values are: "Generalized" and - "Specialized". - :vartype os_state: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemStateTypes - :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :vartype hyper_v_generation: str or ~azure.mgmt.compute.v2022_03_03.models.HyperVGeneration - :ivar end_of_life_date: The end of life date of the gallery image definition. This property can - be used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar identifier: This is the gallery image definition identifier. - :vartype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageIdentifier - :ivar recommended: The properties describe the recommended machine configuration for this Image - Definition. These properties are updatable. - :vartype recommended: ~azure.mgmt.compute.v2022_03_03.models.RecommendedMachineConfiguration - :ivar disallowed: Describes the disallowed disk types. - :vartype disallowed: ~azure.mgmt.compute.v2022_03_03.models.Disallowed - :ivar purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :vartype purchase_plan: ~azure.mgmt.compute.v2022_03_03.models.ImagePurchasePlan - :ivar provisioning_state: The provisioning state, which only appears in the response. Known - values are: "Creating", "Updating", "Failed", "Succeeded", "Deleting", and "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2022_03_03.models.GalleryProvisioningState - :ivar features: A list of gallery image features. - :vartype features: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImageFeature] - :ivar architecture: The architecture of the image. Applicable to OS disks only. Known values - are: "x64" and "Arm64". - :vartype architecture: str or ~azure.mgmt.compute.v2022_03_03.models.Architecture - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "description": {"key": "properties.description", "type": "str"}, - "eula": {"key": "properties.eula", "type": "str"}, - "privacy_statement_uri": {"key": "properties.privacyStatementUri", "type": "str"}, - "release_note_uri": {"key": "properties.releaseNoteUri", "type": "str"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "os_state": {"key": "properties.osState", "type": "str"}, - "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, - "end_of_life_date": {"key": "properties.endOfLifeDate", "type": "iso-8601"}, - "identifier": {"key": "properties.identifier", "type": "GalleryImageIdentifier"}, - "recommended": {"key": "properties.recommended", "type": "RecommendedMachineConfiguration"}, - "disallowed": {"key": "properties.disallowed", "type": "Disallowed"}, - "purchase_plan": {"key": "properties.purchasePlan", "type": "ImagePurchasePlan"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "features": {"key": "properties.features", "type": "[GalleryImageFeature]"}, - "architecture": {"key": "properties.architecture", "type": "str"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - eula: Optional[str] = None, - privacy_statement_uri: Optional[str] = None, - release_note_uri: Optional[str] = None, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - os_state: Optional[Union[str, "_models.OperatingSystemStateTypes"]] = None, - hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, - end_of_life_date: Optional[datetime.datetime] = None, - identifier: Optional["_models.GalleryImageIdentifier"] = None, - recommended: Optional["_models.RecommendedMachineConfiguration"] = None, - disallowed: Optional["_models.Disallowed"] = None, - purchase_plan: Optional["_models.ImagePurchasePlan"] = None, - features: Optional[List["_models.GalleryImageFeature"]] = None, - architecture: Optional[Union[str, "_models.Architecture"]] = None, - **kwargs - ): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword description: The description of this gallery image definition resource. This property - is updatable. - :paramtype description: str - :keyword eula: The Eula agreement for the gallery image definition. - :paramtype eula: str - :keyword privacy_statement_uri: The privacy statement uri. - :paramtype privacy_statement_uri: str - :keyword release_note_uri: The release note uri. - :paramtype release_note_uri: str - :keyword os_type: This property allows you to specify the type of the OS that is included in - the disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :paramtype os_type: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :keyword os_state: This property allows the user to specify whether the virtual machines - created under this image are 'Generalized' or 'Specialized'. Known values are: "Generalized" - and "Specialized". - :paramtype os_state: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemStateTypes - :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :paramtype hyper_v_generation: str or ~azure.mgmt.compute.v2022_03_03.models.HyperVGeneration - :keyword end_of_life_date: The end of life date of the gallery image definition. This property - can be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword identifier: This is the gallery image definition identifier. - :paramtype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageIdentifier - :keyword recommended: The properties describe the recommended machine configuration for this - Image Definition. These properties are updatable. - :paramtype recommended: ~azure.mgmt.compute.v2022_03_03.models.RecommendedMachineConfiguration - :keyword disallowed: Describes the disallowed disk types. - :paramtype disallowed: ~azure.mgmt.compute.v2022_03_03.models.Disallowed - :keyword purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :paramtype purchase_plan: ~azure.mgmt.compute.v2022_03_03.models.ImagePurchasePlan - :keyword features: A list of gallery image features. - :paramtype features: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImageFeature] - :keyword architecture: The architecture of the image. Applicable to OS disks only. Known values - are: "x64" and "Arm64". - :paramtype architecture: str or ~azure.mgmt.compute.v2022_03_03.models.Architecture - """ - super().__init__(tags=tags, **kwargs) - self.description = description - self.eula = eula - self.privacy_statement_uri = privacy_statement_uri - self.release_note_uri = release_note_uri - self.os_type = os_type - self.os_state = os_state - self.hyper_v_generation = hyper_v_generation - self.end_of_life_date = end_of_life_date - self.identifier = identifier - self.recommended = recommended - self.disallowed = disallowed - self.purchase_plan = purchase_plan - self.provisioning_state = None - self.features = features - self.architecture = architecture - - -class GalleryImageVersion(Resource): - """Specifies information about the gallery image version that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar publishing_profile: The publishing profile of a gallery image Version. - :vartype publishing_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionPublishingProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. Known - values are: "Creating", "Updating", "Failed", "Succeeded", "Deleting", and "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2022_03_03.models.GalleryProvisioningState - :ivar storage_profile: This is the storage profile of a Gallery Image Version. - :vartype storage_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionStorageProfile - :ivar safety_profile: This is the safety profile of the Gallery Image Version. - :vartype safety_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionSafetyProfile - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2022_03_03.models.ReplicationStatus - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "provisioning_state": {"readonly": True}, - "replication_status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "publishing_profile": {"key": "properties.publishingProfile", "type": "GalleryImageVersionPublishingProfile"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "storage_profile": {"key": "properties.storageProfile", "type": "GalleryImageVersionStorageProfile"}, - "safety_profile": {"key": "properties.safetyProfile", "type": "GalleryImageVersionSafetyProfile"}, - "replication_status": {"key": "properties.replicationStatus", "type": "ReplicationStatus"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - publishing_profile: Optional["_models.GalleryImageVersionPublishingProfile"] = None, - storage_profile: Optional["_models.GalleryImageVersionStorageProfile"] = None, - safety_profile: Optional["_models.GalleryImageVersionSafetyProfile"] = None, - **kwargs - ): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword publishing_profile: The publishing profile of a gallery image Version. - :paramtype publishing_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionPublishingProfile - :keyword storage_profile: This is the storage profile of a Gallery Image Version. - :paramtype storage_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionStorageProfile - :keyword safety_profile: This is the safety profile of the Gallery Image Version. - :paramtype safety_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionSafetyProfile - """ - super().__init__(location=location, tags=tags, **kwargs) - self.publishing_profile = publishing_profile - self.provisioning_state = None - self.storage_profile = storage_profile - self.safety_profile = safety_profile - self.replication_status = None - - -class GalleryImageVersionList(_serialization.Model): - """The List Gallery Image version operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of gallery image versions. Required. - :vartype value: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :ivar next_link: The uri to fetch the next page of gallery image versions. Call ListNext() with - this to fetch the next page of gallery image versions. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[GalleryImageVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.GalleryImageVersion"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of gallery image versions. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :keyword next_link: The uri to fetch the next page of gallery image versions. Call ListNext() - with this to fetch the next page of gallery image versions. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery image Version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar target_regions: The target regions where the Image Version is going to be replicated to. - This property is updatable. - :vartype target_regions: list[~azure.mgmt.compute.v2022_03_03.models.TargetRegion] - :ivar replica_count: The number of replicas of the Image Version to be created per region. This - property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :vartype replica_count: int - :ivar exclude_from_latest: If set to true, Virtual Machines deployed from the latest version of - the Image Definition won't use this Image Version. - :vartype exclude_from_latest: bool - :ivar published_date: The timestamp for when the gallery image version is published. - :vartype published_date: ~datetime.datetime - :ivar end_of_life_date: The end of life date of the gallery image version. This property can be - used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Known values are: "Standard_LRS", "Standard_ZRS", and - "Premium_LRS". - :vartype storage_account_type: str or ~azure.mgmt.compute.v2022_03_03.models.StorageAccountType - :ivar replication_mode: Optional parameter which specifies the mode to be used for replication. - This property is not updatable. Known values are: "Full" and "Shallow". - :vartype replication_mode: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationMode - :ivar target_extended_locations: The target extended locations where the Image Version is going - to be replicated to. This property is updatable. - :vartype target_extended_locations: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryTargetExtendedLocation] - """ - - _validation = { - "published_date": {"readonly": True}, - } - - _attribute_map = { - "target_regions": {"key": "targetRegions", "type": "[TargetRegion]"}, - "replica_count": {"key": "replicaCount", "type": "int"}, - "exclude_from_latest": {"key": "excludeFromLatest", "type": "bool"}, - "published_date": {"key": "publishedDate", "type": "iso-8601"}, - "end_of_life_date": {"key": "endOfLifeDate", "type": "iso-8601"}, - "storage_account_type": {"key": "storageAccountType", "type": "str"}, - "replication_mode": {"key": "replicationMode", "type": "str"}, - "target_extended_locations": {"key": "targetExtendedLocations", "type": "[GalleryTargetExtendedLocation]"}, - } - - def __init__( - self, - *, - target_regions: Optional[List["_models.TargetRegion"]] = None, - replica_count: Optional[int] = None, - exclude_from_latest: Optional[bool] = None, - end_of_life_date: Optional[datetime.datetime] = None, - storage_account_type: Optional[Union[str, "_models.StorageAccountType"]] = None, - replication_mode: Optional[Union[str, "_models.ReplicationMode"]] = None, - target_extended_locations: Optional[List["_models.GalleryTargetExtendedLocation"]] = None, - **kwargs - ): - """ - :keyword target_regions: The target regions where the Image Version is going to be replicated - to. This property is updatable. - :paramtype target_regions: list[~azure.mgmt.compute.v2022_03_03.models.TargetRegion] - :keyword replica_count: The number of replicas of the Image Version to be created per region. - This property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :paramtype replica_count: int - :keyword exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :paramtype exclude_from_latest: bool - :keyword end_of_life_date: The end of life date of the gallery image version. This property can - be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword storage_account_type: Specifies the storage account type to be used to store the - image. This property is not updatable. Known values are: "Standard_LRS", "Standard_ZRS", and - "Premium_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.compute.v2022_03_03.models.StorageAccountType - :keyword replication_mode: Optional parameter which specifies the mode to be used for - replication. This property is not updatable. Known values are: "Full" and "Shallow". - :paramtype replication_mode: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationMode - :keyword target_extended_locations: The target extended locations where the Image Version is - going to be replicated to. This property is updatable. - :paramtype target_extended_locations: - list[~azure.mgmt.compute.v2022_03_03.models.GalleryTargetExtendedLocation] - """ - super().__init__( - target_regions=target_regions, - replica_count=replica_count, - exclude_from_latest=exclude_from_latest, - end_of_life_date=end_of_life_date, - storage_account_type=storage_account_type, - replication_mode=replication_mode, - target_extended_locations=target_extended_locations, - **kwargs - ) - - -class GalleryImageVersionSafetyProfile(GalleryArtifactSafetyProfileBase): - """This is the safety profile of the Gallery Image Version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar allow_deletion_of_replicated_locations: Indicates whether or not removing this Gallery - Image Version from replicated regions is allowed. - :vartype allow_deletion_of_replicated_locations: bool - :ivar reported_for_policy_violation: Indicates whether this image has been reported as - violating Microsoft's policies. - :vartype reported_for_policy_violation: bool - :ivar policy_violations: A list of Policy Violations that have been reported for this Gallery - Image Version. - :vartype policy_violations: list[~azure.mgmt.compute.v2022_03_03.models.PolicyViolation] - """ - - _validation = { - "reported_for_policy_violation": {"readonly": True}, - "policy_violations": {"readonly": True}, - } - - _attribute_map = { - "allow_deletion_of_replicated_locations": {"key": "allowDeletionOfReplicatedLocations", "type": "bool"}, - "reported_for_policy_violation": {"key": "reportedForPolicyViolation", "type": "bool"}, - "policy_violations": {"key": "policyViolations", "type": "[PolicyViolation]"}, - } - - def __init__(self, *, allow_deletion_of_replicated_locations: Optional[bool] = None, **kwargs): - """ - :keyword allow_deletion_of_replicated_locations: Indicates whether or not removing this Gallery - Image Version from replicated regions is allowed. - :paramtype allow_deletion_of_replicated_locations: bool - """ - super().__init__(allow_deletion_of_replicated_locations=allow_deletion_of_replicated_locations, **kwargs) - self.reported_for_policy_violation = None - self.policy_violations = None - - -class GalleryImageVersionStorageProfile(_serialization.Model): - """This is the storage profile of a Gallery Image Version. - - :ivar source: The source of the gallery artifact version. - :vartype source: ~azure.mgmt.compute.v2022_03_03.models.GalleryArtifactVersionFullSource - :ivar os_disk_image: This is the OS disk image. - :vartype os_disk_image: ~azure.mgmt.compute.v2022_03_03.models.GalleryOSDiskImage - :ivar data_disk_images: A list of data disk images. - :vartype data_disk_images: list[~azure.mgmt.compute.v2022_03_03.models.GalleryDataDiskImage] - """ - - _attribute_map = { - "source": {"key": "source", "type": "GalleryArtifactVersionFullSource"}, - "os_disk_image": {"key": "osDiskImage", "type": "GalleryOSDiskImage"}, - "data_disk_images": {"key": "dataDiskImages", "type": "[GalleryDataDiskImage]"}, - } - - def __init__( - self, - *, - source: Optional["_models.GalleryArtifactVersionFullSource"] = None, - os_disk_image: Optional["_models.GalleryOSDiskImage"] = None, - data_disk_images: Optional[List["_models.GalleryDataDiskImage"]] = None, - **kwargs - ): - """ - :keyword source: The source of the gallery artifact version. - :paramtype source: ~azure.mgmt.compute.v2022_03_03.models.GalleryArtifactVersionFullSource - :keyword os_disk_image: This is the OS disk image. - :paramtype os_disk_image: ~azure.mgmt.compute.v2022_03_03.models.GalleryOSDiskImage - :keyword data_disk_images: A list of data disk images. - :paramtype data_disk_images: list[~azure.mgmt.compute.v2022_03_03.models.GalleryDataDiskImage] - """ - super().__init__(**kwargs) - self.source = source - self.os_disk_image = os_disk_image - self.data_disk_images = data_disk_images - - -class GalleryImageVersionUpdate(UpdateResourceDefinition): - """Specifies information about the gallery image version that you want to update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar publishing_profile: The publishing profile of a gallery image Version. - :vartype publishing_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionPublishingProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. Known - values are: "Creating", "Updating", "Failed", "Succeeded", "Deleting", and "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2022_03_03.models.GalleryProvisioningState - :ivar storage_profile: This is the storage profile of a Gallery Image Version. - :vartype storage_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionStorageProfile - :ivar safety_profile: This is the safety profile of the Gallery Image Version. - :vartype safety_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionSafetyProfile - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2022_03_03.models.ReplicationStatus - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "replication_status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "publishing_profile": {"key": "properties.publishingProfile", "type": "GalleryImageVersionPublishingProfile"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "storage_profile": {"key": "properties.storageProfile", "type": "GalleryImageVersionStorageProfile"}, - "safety_profile": {"key": "properties.safetyProfile", "type": "GalleryImageVersionSafetyProfile"}, - "replication_status": {"key": "properties.replicationStatus", "type": "ReplicationStatus"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - publishing_profile: Optional["_models.GalleryImageVersionPublishingProfile"] = None, - storage_profile: Optional["_models.GalleryImageVersionStorageProfile"] = None, - safety_profile: Optional["_models.GalleryImageVersionSafetyProfile"] = None, - **kwargs - ): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword publishing_profile: The publishing profile of a gallery image Version. - :paramtype publishing_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionPublishingProfile - :keyword storage_profile: This is the storage profile of a Gallery Image Version. - :paramtype storage_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionStorageProfile - :keyword safety_profile: This is the safety profile of the Gallery Image Version. - :paramtype safety_profile: - ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionSafetyProfile - """ - super().__init__(tags=tags, **kwargs) - self.publishing_profile = publishing_profile - self.provisioning_state = None - self.storage_profile = storage_profile - self.safety_profile = safety_profile - self.replication_status = None - - -class GalleryList(_serialization.Model): - """The List Galleries operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of galleries. Required. - :vartype value: list[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :ivar next_link: The uri to fetch the next page of galleries. Call ListNext() with this to - fetch the next page of galleries. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Gallery]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Gallery"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of galleries. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :keyword next_link: The uri to fetch the next page of galleries. Call ListNext() with this to - fetch the next page of galleries. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class GalleryOSDiskImage(GalleryDiskImage): - """This is the OS disk image. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar size_in_gb: This property indicates the size of the VHD to be created. - :vartype size_in_gb: int - :ivar host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :vartype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.HostCaching - :ivar source: The source for the disk image. - :vartype source: ~azure.mgmt.compute.v2022_03_03.models.GalleryDiskImageSource - """ - - _validation = { - "size_in_gb": {"readonly": True}, - } - - _attribute_map = { - "size_in_gb": {"key": "sizeInGB", "type": "int"}, - "host_caching": {"key": "hostCaching", "type": "str"}, - "source": {"key": "source", "type": "GalleryDiskImageSource"}, - } - - def __init__( - self, - *, - host_caching: Optional[Union[str, "_models.HostCaching"]] = None, - source: Optional["_models.GalleryDiskImageSource"] = None, - **kwargs - ): - """ - :keyword host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :paramtype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.HostCaching - :keyword source: The source for the disk image. - :paramtype source: ~azure.mgmt.compute.v2022_03_03.models.GalleryDiskImageSource - """ - super().__init__(host_caching=host_caching, source=source, **kwargs) - - -class GalleryTargetExtendedLocation(_serialization.Model): - """GalleryTargetExtendedLocation. - - :ivar name: The name of the region. - :vartype name: str - :ivar extended_location: The name of the extended location. - :vartype extended_location: ~azure.mgmt.compute.v2022_03_03.models.GalleryExtendedLocation - :ivar extended_location_replica_count: The number of replicas of the Image Version to be - created per extended location. This property is updatable. - :vartype extended_location_replica_count: int - :ivar storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Known values are: "Standard_LRS", "Standard_ZRS", and - "Premium_LRS". - :vartype storage_account_type: str or ~azure.mgmt.compute.v2022_03_03.models.StorageAccountType - :ivar encryption: Optional. Allows users to provide customer managed keys for encrypting the OS - and data disks in the gallery artifact. - :vartype encryption: ~azure.mgmt.compute.v2022_03_03.models.EncryptionImages - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "extended_location": {"key": "extendedLocation", "type": "GalleryExtendedLocation"}, - "extended_location_replica_count": {"key": "extendedLocationReplicaCount", "type": "int"}, - "storage_account_type": {"key": "storageAccountType", "type": "str"}, - "encryption": {"key": "encryption", "type": "EncryptionImages"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - extended_location: Optional["_models.GalleryExtendedLocation"] = None, - extended_location_replica_count: Optional[int] = None, - storage_account_type: Optional[Union[str, "_models.StorageAccountType"]] = None, - encryption: Optional["_models.EncryptionImages"] = None, - **kwargs - ): - """ - :keyword name: The name of the region. - :paramtype name: str - :keyword extended_location: The name of the extended location. - :paramtype extended_location: ~azure.mgmt.compute.v2022_03_03.models.GalleryExtendedLocation - :keyword extended_location_replica_count: The number of replicas of the Image Version to be - created per extended location. This property is updatable. - :paramtype extended_location_replica_count: int - :keyword storage_account_type: Specifies the storage account type to be used to store the - image. This property is not updatable. Known values are: "Standard_LRS", "Standard_ZRS", and - "Premium_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.compute.v2022_03_03.models.StorageAccountType - :keyword encryption: Optional. Allows users to provide customer managed keys for encrypting the - OS and data disks in the gallery artifact. - :paramtype encryption: ~azure.mgmt.compute.v2022_03_03.models.EncryptionImages - """ - super().__init__(**kwargs) - self.name = name - self.extended_location = extended_location - self.extended_location_replica_count = extended_location_replica_count - self.storage_account_type = storage_account_type - self.encryption = encryption - - -class GalleryUpdate(UpdateResourceDefinition): - """Specifies information about the Shared Image Gallery that you want to update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar description: The description of this Shared Image Gallery resource. This property is - updatable. - :vartype description: str - :ivar identifier: Describes the gallery unique name. - :vartype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryIdentifier - :ivar provisioning_state: The provisioning state, which only appears in the response. Known - values are: "Creating", "Updating", "Failed", "Succeeded", "Deleting", and "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2022_03_03.models.GalleryProvisioningState - :ivar sharing_profile: Profile for gallery sharing to subscription or tenant. - :vartype sharing_profile: ~azure.mgmt.compute.v2022_03_03.models.SharingProfile - :ivar soft_delete_policy: Contains information about the soft deletion policy of the gallery. - :vartype soft_delete_policy: ~azure.mgmt.compute.v2022_03_03.models.SoftDeletePolicy - :ivar sharing_status: Sharing status of current gallery. - :vartype sharing_status: ~azure.mgmt.compute.v2022_03_03.models.SharingStatus - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "sharing_status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "description": {"key": "properties.description", "type": "str"}, - "identifier": {"key": "properties.identifier", "type": "GalleryIdentifier"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "sharing_profile": {"key": "properties.sharingProfile", "type": "SharingProfile"}, - "soft_delete_policy": {"key": "properties.softDeletePolicy", "type": "SoftDeletePolicy"}, - "sharing_status": {"key": "properties.sharingStatus", "type": "SharingStatus"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - identifier: Optional["_models.GalleryIdentifier"] = None, - sharing_profile: Optional["_models.SharingProfile"] = None, - soft_delete_policy: Optional["_models.SoftDeletePolicy"] = None, - **kwargs - ): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword description: The description of this Shared Image Gallery resource. This property is - updatable. - :paramtype description: str - :keyword identifier: Describes the gallery unique name. - :paramtype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryIdentifier - :keyword sharing_profile: Profile for gallery sharing to subscription or tenant. - :paramtype sharing_profile: ~azure.mgmt.compute.v2022_03_03.models.SharingProfile - :keyword soft_delete_policy: Contains information about the soft deletion policy of the - gallery. - :paramtype soft_delete_policy: ~azure.mgmt.compute.v2022_03_03.models.SoftDeletePolicy - """ - super().__init__(tags=tags, **kwargs) - self.description = description - self.identifier = identifier - self.provisioning_state = None - self.sharing_profile = sharing_profile - self.soft_delete_policy = soft_delete_policy - self.sharing_status = None - - -class ImagePurchasePlan(_serialization.Model): - """Describes the gallery image definition purchase plan. This is used by marketplace images. - - :ivar name: The plan ID. - :vartype name: str - :ivar publisher: The publisher ID. - :vartype publisher: str - :ivar product: The product ID. - :vartype product: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "publisher": {"key": "publisher", "type": "str"}, - "product": {"key": "product", "type": "str"}, - } - - def __init__( - self, *, name: Optional[str] = None, publisher: Optional[str] = None, product: Optional[str] = None, **kwargs - ): - """ - :keyword name: The plan ID. - :paramtype name: str - :keyword publisher: The publisher ID. - :paramtype publisher: str - :keyword product: The product ID. - :paramtype product: str - """ - super().__init__(**kwargs) - self.name = name - self.publisher = publisher - self.product = product - - -class InnerError(_serialization.Model): - """Inner error details. - - :ivar exceptiontype: The exception type. - :vartype exceptiontype: str - :ivar errordetail: The internal error message or exception dump. - :vartype errordetail: str - """ - - _attribute_map = { - "exceptiontype": {"key": "exceptiontype", "type": "str"}, - "errordetail": {"key": "errordetail", "type": "str"}, - } - - def __init__(self, *, exceptiontype: Optional[str] = None, errordetail: Optional[str] = None, **kwargs): - """ - :keyword exceptiontype: The exception type. - :paramtype exceptiontype: str - :keyword errordetail: The internal error message or exception dump. - :paramtype errordetail: str - """ - super().__init__(**kwargs) - self.exceptiontype = exceptiontype - self.errordetail = errordetail - - -class LatestGalleryImageVersion(_serialization.Model): - """The gallery image version with latest version in a particular region. - - :ivar latest_version_name: The name of the latest version in the region. - :vartype latest_version_name: str - :ivar location: region of the Gallery Image Version. - :vartype location: str - """ - - _attribute_map = { - "latest_version_name": {"key": "latestVersionName", "type": "str"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, latest_version_name: Optional[str] = None, location: Optional[str] = None, **kwargs): - """ - :keyword latest_version_name: The name of the latest version in the region. - :paramtype latest_version_name: str - :keyword location: region of the Gallery Image Version. - :paramtype location: str - """ - super().__init__(**kwargs) - self.latest_version_name = latest_version_name - self.location = location - - -class ManagedArtifact(_serialization.Model): - """The managed artifact. - - All required parameters must be populated in order to send to Azure. - - :ivar id: The managed artifact id. Required. - :vartype id: str - """ - - _validation = { - "id": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin - """ - :keyword id: The managed artifact id. Required. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class OSDiskImageEncryption(DiskImageEncryption): - """Contains encryption settings for an OS disk image. - - :ivar disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption - set. - :vartype disk_encryption_set_id: str - :ivar security_profile: This property specifies the security profile of an OS disk image. - :vartype security_profile: ~azure.mgmt.compute.v2022_03_03.models.OSDiskImageSecurityProfile - """ - - _attribute_map = { - "disk_encryption_set_id": {"key": "diskEncryptionSetId", "type": "str"}, - "security_profile": {"key": "securityProfile", "type": "OSDiskImageSecurityProfile"}, - } - - def __init__( - self, - *, - disk_encryption_set_id: Optional[str] = None, - security_profile: Optional["_models.OSDiskImageSecurityProfile"] = None, - **kwargs - ): - """ - :keyword disk_encryption_set_id: A relative URI containing the resource ID of the disk - encryption set. - :paramtype disk_encryption_set_id: str - :keyword security_profile: This property specifies the security profile of an OS disk image. - :paramtype security_profile: ~azure.mgmt.compute.v2022_03_03.models.OSDiskImageSecurityProfile - """ - super().__init__(disk_encryption_set_id=disk_encryption_set_id, **kwargs) - self.security_profile = security_profile - - -class OSDiskImageSecurityProfile(_serialization.Model): - """Contains security profile for an OS disk image. - - :ivar confidential_vm_encryption_type: confidential VM encryption types. Known values are: - "EncryptedVMGuestStateOnlyWithPmk", "EncryptedWithPmk", and "EncryptedWithCmk". - :vartype confidential_vm_encryption_type: str or - ~azure.mgmt.compute.v2022_03_03.models.ConfidentialVMEncryptionType - :ivar secure_vm_disk_encryption_set_id: secure VM disk encryption set id. - :vartype secure_vm_disk_encryption_set_id: str - """ - - _attribute_map = { - "confidential_vm_encryption_type": {"key": "confidentialVMEncryptionType", "type": "str"}, - "secure_vm_disk_encryption_set_id": {"key": "secureVMDiskEncryptionSetId", "type": "str"}, - } - - def __init__( - self, - *, - confidential_vm_encryption_type: Optional[Union[str, "_models.ConfidentialVMEncryptionType"]] = None, - secure_vm_disk_encryption_set_id: Optional[str] = None, - **kwargs - ): - """ - :keyword confidential_vm_encryption_type: confidential VM encryption types. Known values are: - "EncryptedVMGuestStateOnlyWithPmk", "EncryptedWithPmk", and "EncryptedWithCmk". - :paramtype confidential_vm_encryption_type: str or - ~azure.mgmt.compute.v2022_03_03.models.ConfidentialVMEncryptionType - :keyword secure_vm_disk_encryption_set_id: secure VM disk encryption set id. - :paramtype secure_vm_disk_encryption_set_id: str - """ - super().__init__(**kwargs) - self.confidential_vm_encryption_type = confidential_vm_encryption_type - self.secure_vm_disk_encryption_set_id = secure_vm_disk_encryption_set_id - - -class PirResource(_serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.name = None - self.location = None - - -class PirSharedGalleryResource(PirResource): - """Base information about the shared gallery resource in pir. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - :ivar unique_id: The unique id of this shared gallery. - :vartype unique_id: str - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "unique_id": {"key": "identifier.uniqueId", "type": "str"}, - } - - def __init__(self, *, unique_id: Optional[str] = None, **kwargs): - """ - :keyword unique_id: The unique id of this shared gallery. - :paramtype unique_id: str - """ - super().__init__(**kwargs) - self.unique_id = unique_id - - -class PolicyViolation(_serialization.Model): - """A policy violation reported against a gallery artifact. - - :ivar category: Describes the nature of the policy violation. Known values are: "Other", - "ImageFlaggedUnsafe", "CopyrightValidation", and "IpTheft". - :vartype category: str or ~azure.mgmt.compute.v2022_03_03.models.PolicyViolationCategory - :ivar details: Describes specific details about why this policy violation was reported. - :vartype details: str - """ - - _attribute_map = { - "category": {"key": "category", "type": "str"}, - "details": {"key": "details", "type": "str"}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "_models.PolicyViolationCategory"]] = None, - details: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Describes the nature of the policy violation. Known values are: "Other", - "ImageFlaggedUnsafe", "CopyrightValidation", and "IpTheft". - :paramtype category: str or ~azure.mgmt.compute.v2022_03_03.models.PolicyViolationCategory - :keyword details: Describes specific details about why this policy violation was reported. - :paramtype details: str - """ - super().__init__(**kwargs) - self.category = category - self.details = details - - -class RecommendedMachineConfiguration(_serialization.Model): - """The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. - - :ivar v_cp_us: Describes the resource range. - :vartype v_cp_us: ~azure.mgmt.compute.v2022_03_03.models.ResourceRange - :ivar memory: Describes the resource range. - :vartype memory: ~azure.mgmt.compute.v2022_03_03.models.ResourceRange - """ - - _attribute_map = { - "v_cp_us": {"key": "vCPUs", "type": "ResourceRange"}, - "memory": {"key": "memory", "type": "ResourceRange"}, - } - - def __init__( - self, - *, - v_cp_us: Optional["_models.ResourceRange"] = None, - memory: Optional["_models.ResourceRange"] = None, - **kwargs - ): - """ - :keyword v_cp_us: Describes the resource range. - :paramtype v_cp_us: ~azure.mgmt.compute.v2022_03_03.models.ResourceRange - :keyword memory: Describes the resource range. - :paramtype memory: ~azure.mgmt.compute.v2022_03_03.models.ResourceRange - """ - super().__init__(**kwargs) - self.v_cp_us = v_cp_us - self.memory = memory - - -class RegionalReplicationStatus(_serialization.Model): - """This is the regional replication status. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar region: The region to which the gallery image version is being replicated to. - :vartype region: str - :ivar state: This is the regional replication state. Known values are: "Unknown", - "Replicating", "Completed", and "Failed". - :vartype state: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationState - :ivar details: The details of the replication status. - :vartype details: str - :ivar progress: It indicates progress of the replication job. - :vartype progress: int - """ - - _validation = { - "region": {"readonly": True}, - "state": {"readonly": True}, - "details": {"readonly": True}, - "progress": {"readonly": True}, - } - - _attribute_map = { - "region": {"key": "region", "type": "str"}, - "state": {"key": "state", "type": "str"}, - "details": {"key": "details", "type": "str"}, - "progress": {"key": "progress", "type": "int"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.region = None - self.state = None - self.details = None - self.progress = None - - -class RegionalSharingStatus(_serialization.Model): - """Gallery regional sharing status. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar region: Region name. - :vartype region: str - :ivar state: Gallery sharing state in current region. Known values are: "Succeeded", - "InProgress", "Failed", and "Unknown". - :vartype state: str or ~azure.mgmt.compute.v2022_03_03.models.SharingState - :ivar details: Details of gallery regional sharing failure. - :vartype details: str - """ - - _validation = { - "state": {"readonly": True}, - } - - _attribute_map = { - "region": {"key": "region", "type": "str"}, - "state": {"key": "state", "type": "str"}, - "details": {"key": "details", "type": "str"}, - } - - def __init__(self, *, region: Optional[str] = None, details: Optional[str] = None, **kwargs): - """ - :keyword region: Region name. - :paramtype region: str - :keyword details: Details of gallery regional sharing failure. - :paramtype details: str - """ - super().__init__(**kwargs) - self.region = region - self.state = None - self.details = details - - -class ReplicationStatus(_serialization.Model): - """This is the replication status of the gallery image version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar aggregated_state: This is the aggregated replication status based on all the regional - replication status flags. Known values are: "Unknown", "InProgress", "Completed", and "Failed". - :vartype aggregated_state: str or - ~azure.mgmt.compute.v2022_03_03.models.AggregatedReplicationState - :ivar summary: This is a summary of replication status for each region. - :vartype summary: list[~azure.mgmt.compute.v2022_03_03.models.RegionalReplicationStatus] - """ - - _validation = { - "aggregated_state": {"readonly": True}, - "summary": {"readonly": True}, - } - - _attribute_map = { - "aggregated_state": {"key": "aggregatedState", "type": "str"}, - "summary": {"key": "summary", "type": "[RegionalReplicationStatus]"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.aggregated_state = None - self.summary = None - - -class ResourceRange(_serialization.Model): - """Describes the resource range. - - :ivar min: The minimum number of the resource. - :vartype min: int - :ivar max: The maximum number of the resource. - :vartype max: int - """ - - _attribute_map = { - "min": {"key": "min", "type": "int"}, - "max": {"key": "max", "type": "int"}, - } - - def __init__( - self, - *, - min: Optional[int] = None, # pylint: disable=redefined-builtin - max: Optional[int] = None, # pylint: disable=redefined-builtin - **kwargs - ): - """ - :keyword min: The minimum number of the resource. - :paramtype min: int - :keyword max: The maximum number of the resource. - :paramtype max: int - """ - super().__init__(**kwargs) - self.min = min - self.max = max - - -class SharedGallery(PirSharedGalleryResource): - """Specifies information about the Shared Gallery that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - :ivar unique_id: The unique id of this shared gallery. - :vartype unique_id: str - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "unique_id": {"key": "identifier.uniqueId", "type": "str"}, - } - - def __init__(self, *, unique_id: Optional[str] = None, **kwargs): - """ - :keyword unique_id: The unique id of this shared gallery. - :paramtype unique_id: str - """ - super().__init__(unique_id=unique_id, **kwargs) - - -class SharedGalleryDiskImage(_serialization.Model): - """This is the disk image base class. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar disk_size_gb: This property indicates the size of the VHD to be created. - :vartype disk_size_gb: int - :ivar host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :vartype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryHostCaching - """ - - _validation = { - "disk_size_gb": {"readonly": True}, - } - - _attribute_map = { - "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, - "host_caching": {"key": "hostCaching", "type": "str"}, - } - - def __init__(self, *, host_caching: Optional[Union[str, "_models.SharedGalleryHostCaching"]] = None, **kwargs): - """ - :keyword host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :paramtype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryHostCaching - """ - super().__init__(**kwargs) - self.disk_size_gb = None - self.host_caching = host_caching - - -class SharedGalleryDataDiskImage(SharedGalleryDiskImage): - """This is the data disk image. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar disk_size_gb: This property indicates the size of the VHD to be created. - :vartype disk_size_gb: int - :ivar host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :vartype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryHostCaching - :ivar lun: This property specifies the logical unit number of the data disk. This value is used - to identify data disks within the Virtual Machine and therefore must be unique for each data - disk attached to the Virtual Machine. Required. - :vartype lun: int - """ - - _validation = { - "disk_size_gb": {"readonly": True}, - "lun": {"required": True}, - } - - _attribute_map = { - "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, - "host_caching": {"key": "hostCaching", "type": "str"}, - "lun": {"key": "lun", "type": "int"}, - } - - def __init__( - self, *, lun: int, host_caching: Optional[Union[str, "_models.SharedGalleryHostCaching"]] = None, **kwargs - ): - """ - :keyword host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :paramtype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryHostCaching - :keyword lun: This property specifies the logical unit number of the data disk. This value is - used to identify data disks within the Virtual Machine and therefore must be unique for each - data disk attached to the Virtual Machine. Required. - :paramtype lun: int - """ - super().__init__(host_caching=host_caching, **kwargs) - self.lun = lun - - -class SharedGalleryImage(PirSharedGalleryResource): # pylint: disable=too-many-instance-attributes - """Specifies information about the gallery image definition that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - :ivar unique_id: The unique id of this shared gallery. - :vartype unique_id: str - :ivar os_type: This property allows you to specify the type of the OS that is included in the - disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :ivar os_state: This property allows the user to specify whether the virtual machines created - under this image are 'Generalized' or 'Specialized'. Known values are: "Generalized" and - "Specialized". - :vartype os_state: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemStateTypes - :ivar end_of_life_date: The end of life date of the gallery image definition. This property can - be used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar identifier: This is the gallery image definition identifier. - :vartype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageIdentifier - :ivar recommended: The properties describe the recommended machine configuration for this Image - Definition. These properties are updatable. - :vartype recommended: ~azure.mgmt.compute.v2022_03_03.models.RecommendedMachineConfiguration - :ivar disallowed: Describes the disallowed disk types. - :vartype disallowed: ~azure.mgmt.compute.v2022_03_03.models.Disallowed - :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :vartype hyper_v_generation: str or ~azure.mgmt.compute.v2022_03_03.models.HyperVGeneration - :ivar features: A list of gallery image features. - :vartype features: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImageFeature] - :ivar purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :vartype purchase_plan: ~azure.mgmt.compute.v2022_03_03.models.ImagePurchasePlan - :ivar architecture: The architecture of the image. Applicable to OS disks only. Known values - are: "x64" and "Arm64". - :vartype architecture: str or ~azure.mgmt.compute.v2022_03_03.models.Architecture - :ivar privacy_statement_uri: Privacy statement uri for the current community gallery image. - :vartype privacy_statement_uri: str - :ivar eula: End-user license agreement for the current community gallery image. - :vartype eula: str - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "unique_id": {"key": "identifier.uniqueId", "type": "str"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "os_state": {"key": "properties.osState", "type": "str"}, - "end_of_life_date": {"key": "properties.endOfLifeDate", "type": "iso-8601"}, - "identifier": {"key": "properties.identifier", "type": "GalleryImageIdentifier"}, - "recommended": {"key": "properties.recommended", "type": "RecommendedMachineConfiguration"}, - "disallowed": {"key": "properties.disallowed", "type": "Disallowed"}, - "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, - "features": {"key": "properties.features", "type": "[GalleryImageFeature]"}, - "purchase_plan": {"key": "properties.purchasePlan", "type": "ImagePurchasePlan"}, - "architecture": {"key": "properties.architecture", "type": "str"}, - "privacy_statement_uri": {"key": "properties.privacyStatementUri", "type": "str"}, - "eula": {"key": "properties.eula", "type": "str"}, - } - - def __init__( - self, - *, - unique_id: Optional[str] = None, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - os_state: Optional[Union[str, "_models.OperatingSystemStateTypes"]] = None, - end_of_life_date: Optional[datetime.datetime] = None, - identifier: Optional["_models.GalleryImageIdentifier"] = None, - recommended: Optional["_models.RecommendedMachineConfiguration"] = None, - disallowed: Optional["_models.Disallowed"] = None, - hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, - features: Optional[List["_models.GalleryImageFeature"]] = None, - purchase_plan: Optional["_models.ImagePurchasePlan"] = None, - architecture: Optional[Union[str, "_models.Architecture"]] = None, - privacy_statement_uri: Optional[str] = None, - eula: Optional[str] = None, - **kwargs - ): - """ - :keyword unique_id: The unique id of this shared gallery. - :paramtype unique_id: str - :keyword os_type: This property allows you to specify the type of the OS that is included in - the disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Known values are: - "Windows" and "Linux". - :paramtype os_type: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemTypes - :keyword os_state: This property allows the user to specify whether the virtual machines - created under this image are 'Generalized' or 'Specialized'. Known values are: "Generalized" - and "Specialized". - :paramtype os_state: str or ~azure.mgmt.compute.v2022_03_03.models.OperatingSystemStateTypes - :keyword end_of_life_date: The end of life date of the gallery image definition. This property - can be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword identifier: This is the gallery image definition identifier. - :paramtype identifier: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageIdentifier - :keyword recommended: The properties describe the recommended machine configuration for this - Image Definition. These properties are updatable. - :paramtype recommended: ~azure.mgmt.compute.v2022_03_03.models.RecommendedMachineConfiguration - :keyword disallowed: Describes the disallowed disk types. - :paramtype disallowed: ~azure.mgmt.compute.v2022_03_03.models.Disallowed - :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :paramtype hyper_v_generation: str or ~azure.mgmt.compute.v2022_03_03.models.HyperVGeneration - :keyword features: A list of gallery image features. - :paramtype features: list[~azure.mgmt.compute.v2022_03_03.models.GalleryImageFeature] - :keyword purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :paramtype purchase_plan: ~azure.mgmt.compute.v2022_03_03.models.ImagePurchasePlan - :keyword architecture: The architecture of the image. Applicable to OS disks only. Known values - are: "x64" and "Arm64". - :paramtype architecture: str or ~azure.mgmt.compute.v2022_03_03.models.Architecture - :keyword privacy_statement_uri: Privacy statement uri for the current community gallery image. - :paramtype privacy_statement_uri: str - :keyword eula: End-user license agreement for the current community gallery image. - :paramtype eula: str - """ - super().__init__(unique_id=unique_id, **kwargs) - self.os_type = os_type - self.os_state = os_state - self.end_of_life_date = end_of_life_date - self.identifier = identifier - self.recommended = recommended - self.disallowed = disallowed - self.hyper_v_generation = hyper_v_generation - self.features = features - self.purchase_plan = purchase_plan - self.architecture = architecture - self.privacy_statement_uri = privacy_statement_uri - self.eula = eula - - -class SharedGalleryImageList(_serialization.Model): - """The List Shared Gallery Images operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of shared gallery images. Required. - :vartype value: list[~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImage] - :ivar next_link: The uri to fetch the next page of shared gallery images. Call ListNext() with - this to fetch the next page of shared gallery images. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SharedGalleryImage]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.SharedGalleryImage"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of shared gallery images. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImage] - :keyword next_link: The uri to fetch the next page of shared gallery images. Call ListNext() - with this to fetch the next page of shared gallery images. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SharedGalleryImageVersion(PirSharedGalleryResource): - """Specifies information about the gallery image version that you want to create or update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - :ivar unique_id: The unique id of this shared gallery. - :vartype unique_id: str - :ivar published_date: The published date of the gallery image version Definition. This property - can be used for decommissioning purposes. This property is updatable. - :vartype published_date: ~datetime.datetime - :ivar end_of_life_date: The end of life date of the gallery image version Definition. This - property can be used for decommissioning purposes. This property is updatable. - :vartype end_of_life_date: ~datetime.datetime - :ivar exclude_from_latest: If set to true, Virtual Machines deployed from the latest version of - the Image Definition won't use this Image Version. - :vartype exclude_from_latest: bool - :ivar storage_profile: Describes the storage profile of the image version. - :vartype storage_profile: - ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImageVersionStorageProfile - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "unique_id": {"key": "identifier.uniqueId", "type": "str"}, - "published_date": {"key": "properties.publishedDate", "type": "iso-8601"}, - "end_of_life_date": {"key": "properties.endOfLifeDate", "type": "iso-8601"}, - "exclude_from_latest": {"key": "properties.excludeFromLatest", "type": "bool"}, - "storage_profile": {"key": "properties.storageProfile", "type": "SharedGalleryImageVersionStorageProfile"}, - } - - def __init__( - self, - *, - unique_id: Optional[str] = None, - published_date: Optional[datetime.datetime] = None, - end_of_life_date: Optional[datetime.datetime] = None, - exclude_from_latest: Optional[bool] = None, - storage_profile: Optional["_models.SharedGalleryImageVersionStorageProfile"] = None, - **kwargs - ): - """ - :keyword unique_id: The unique id of this shared gallery. - :paramtype unique_id: str - :keyword published_date: The published date of the gallery image version Definition. This - property can be used for decommissioning purposes. This property is updatable. - :paramtype published_date: ~datetime.datetime - :keyword end_of_life_date: The end of life date of the gallery image version Definition. This - property can be used for decommissioning purposes. This property is updatable. - :paramtype end_of_life_date: ~datetime.datetime - :keyword exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :paramtype exclude_from_latest: bool - :keyword storage_profile: Describes the storage profile of the image version. - :paramtype storage_profile: - ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImageVersionStorageProfile - """ - super().__init__(unique_id=unique_id, **kwargs) - self.published_date = published_date - self.end_of_life_date = end_of_life_date - self.exclude_from_latest = exclude_from_latest - self.storage_profile = storage_profile - - -class SharedGalleryImageVersionList(_serialization.Model): - """The List Shared Gallery Image versions operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of shared gallery images versions. Required. - :vartype value: list[~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImageVersion] - :ivar next_link: The uri to fetch the next page of shared gallery image versions. Call - ListNext() with this to fetch the next page of shared gallery image versions. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SharedGalleryImageVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.SharedGalleryImageVersion"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of shared gallery images versions. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImageVersion] - :keyword next_link: The uri to fetch the next page of shared gallery image versions. Call - ListNext() with this to fetch the next page of shared gallery image versions. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SharedGalleryImageVersionStorageProfile(_serialization.Model): - """This is the storage profile of a Gallery Image Version. - - :ivar os_disk_image: This is the OS disk image. - :vartype os_disk_image: ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryOSDiskImage - :ivar data_disk_images: A list of data disk images. - :vartype data_disk_images: - list[~azure.mgmt.compute.v2022_03_03.models.SharedGalleryDataDiskImage] - """ - - _attribute_map = { - "os_disk_image": {"key": "osDiskImage", "type": "SharedGalleryOSDiskImage"}, - "data_disk_images": {"key": "dataDiskImages", "type": "[SharedGalleryDataDiskImage]"}, - } - - def __init__( - self, - *, - os_disk_image: Optional["_models.SharedGalleryOSDiskImage"] = None, - data_disk_images: Optional[List["_models.SharedGalleryDataDiskImage"]] = None, - **kwargs - ): - """ - :keyword os_disk_image: This is the OS disk image. - :paramtype os_disk_image: ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryOSDiskImage - :keyword data_disk_images: A list of data disk images. - :paramtype data_disk_images: - list[~azure.mgmt.compute.v2022_03_03.models.SharedGalleryDataDiskImage] - """ - super().__init__(**kwargs) - self.os_disk_image = os_disk_image - self.data_disk_images = data_disk_images - - -class SharedGalleryList(_serialization.Model): - """The List Shared Galleries operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of shared galleries. Required. - :vartype value: list[~azure.mgmt.compute.v2022_03_03.models.SharedGallery] - :ivar next_link: The uri to fetch the next page of shared galleries. Call ListNext() with this - to fetch the next page of shared galleries. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SharedGallery]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.SharedGallery"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of shared galleries. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_03_03.models.SharedGallery] - :keyword next_link: The uri to fetch the next page of shared galleries. Call ListNext() with - this to fetch the next page of shared galleries. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SharedGalleryOSDiskImage(SharedGalleryDiskImage): - """This is the OS disk image. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar disk_size_gb: This property indicates the size of the VHD to be created. - :vartype disk_size_gb: int - :ivar host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :vartype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryHostCaching - """ - - _validation = { - "disk_size_gb": {"readonly": True}, - } - - _attribute_map = { - "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, - "host_caching": {"key": "hostCaching", "type": "str"}, - } - - def __init__(self, *, host_caching: Optional[Union[str, "_models.SharedGalleryHostCaching"]] = None, **kwargs): - """ - :keyword host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Known values are: "None", "ReadOnly", and "ReadWrite". - :paramtype host_caching: str or ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryHostCaching - """ - super().__init__(host_caching=host_caching, **kwargs) - - -class SharingProfile(_serialization.Model): - """Profile for gallery sharing to subscription or tenant. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar permissions: This property allows you to specify the permission of sharing gallery. - :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Private** - :code:`
`:code:`
` **Groups** :code:`
`:code:`
` **Community**. Known values are: - "Private", "Groups", and "Community". - :vartype permissions: str or - ~azure.mgmt.compute.v2022_03_03.models.GallerySharingPermissionTypes - :ivar groups: A list of sharing profile groups. - :vartype groups: list[~azure.mgmt.compute.v2022_03_03.models.SharingProfileGroup] - :ivar community_gallery_info: Information of community gallery if current gallery is shared to - community. - :vartype community_gallery_info: ~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryInfo - """ - - _validation = { - "groups": {"readonly": True}, - } - - _attribute_map = { - "permissions": {"key": "permissions", "type": "str"}, - "groups": {"key": "groups", "type": "[SharingProfileGroup]"}, - "community_gallery_info": {"key": "communityGalleryInfo", "type": "CommunityGalleryInfo"}, - } - - def __init__( - self, - *, - permissions: Optional[Union[str, "_models.GallerySharingPermissionTypes"]] = None, - community_gallery_info: Optional["_models.CommunityGalleryInfo"] = None, - **kwargs - ): - """ - :keyword permissions: This property allows you to specify the permission of sharing gallery. - :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Private** - :code:`
`:code:`
` **Groups** :code:`
`:code:`
` **Community**. Known values are: - "Private", "Groups", and "Community". - :paramtype permissions: str or - ~azure.mgmt.compute.v2022_03_03.models.GallerySharingPermissionTypes - :keyword community_gallery_info: Information of community gallery if current gallery is shared - to community. - :paramtype community_gallery_info: ~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryInfo - """ - super().__init__(**kwargs) - self.permissions = permissions - self.groups = None - self.community_gallery_info = community_gallery_info - - -class SharingProfileGroup(_serialization.Model): - """Group of the gallery sharing profile. - - :ivar type: This property allows you to specify the type of sharing group. - :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Subscriptions** - :code:`
`:code:`
` **AADTenants**. Known values are: "Subscriptions" and "AADTenants". - :vartype type: str or ~azure.mgmt.compute.v2022_03_03.models.SharingProfileGroupTypes - :ivar ids: A list of subscription/tenant ids the gallery is aimed to be shared to. - :vartype ids: list[str] - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "ids": {"key": "ids", "type": "[str]"}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "_models.SharingProfileGroupTypes"]] = None, - ids: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword type: This property allows you to specify the type of sharing group. - :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Subscriptions** - :code:`
`:code:`
` **AADTenants**. Known values are: "Subscriptions" and "AADTenants". - :paramtype type: str or ~azure.mgmt.compute.v2022_03_03.models.SharingProfileGroupTypes - :keyword ids: A list of subscription/tenant ids the gallery is aimed to be shared to. - :paramtype ids: list[str] - """ - super().__init__(**kwargs) - self.type = type - self.ids = ids - - -class SharingStatus(_serialization.Model): - """Sharing status of current gallery. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar aggregated_state: Aggregated sharing state of current gallery. Known values are: - "Succeeded", "InProgress", "Failed", and "Unknown". - :vartype aggregated_state: str or ~azure.mgmt.compute.v2022_03_03.models.SharingState - :ivar summary: Summary of all regional sharing status. - :vartype summary: list[~azure.mgmt.compute.v2022_03_03.models.RegionalSharingStatus] - """ - - _validation = { - "aggregated_state": {"readonly": True}, - } - - _attribute_map = { - "aggregated_state": {"key": "aggregatedState", "type": "str"}, - "summary": {"key": "summary", "type": "[RegionalSharingStatus]"}, - } - - def __init__(self, *, summary: Optional[List["_models.RegionalSharingStatus"]] = None, **kwargs): - """ - :keyword summary: Summary of all regional sharing status. - :paramtype summary: list[~azure.mgmt.compute.v2022_03_03.models.RegionalSharingStatus] - """ - super().__init__(**kwargs) - self.aggregated_state = None - self.summary = summary - - -class SharingUpdate(_serialization.Model): - """Specifies information about the gallery sharing profile update. - - All required parameters must be populated in order to send to Azure. - - :ivar operation_type: This property allows you to specify the operation type of gallery sharing - update. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Add** - :code:`
`:code:`
` **Remove** :code:`
`:code:`
` **Reset**. Required. Known values - are: "Add", "Remove", "Reset", and "EnableCommunity". - :vartype operation_type: str or - ~azure.mgmt.compute.v2022_03_03.models.SharingUpdateOperationTypes - :ivar groups: A list of sharing profile groups. - :vartype groups: list[~azure.mgmt.compute.v2022_03_03.models.SharingProfileGroup] - """ - - _validation = { - "operation_type": {"required": True}, - } - - _attribute_map = { - "operation_type": {"key": "operationType", "type": "str"}, - "groups": {"key": "groups", "type": "[SharingProfileGroup]"}, - } - - def __init__( - self, - *, - operation_type: Union[str, "_models.SharingUpdateOperationTypes"], - groups: Optional[List["_models.SharingProfileGroup"]] = None, - **kwargs - ): - """ - :keyword operation_type: This property allows you to specify the operation type of gallery - sharing update. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Add** - :code:`
`:code:`
` **Remove** :code:`
`:code:`
` **Reset**. Required. Known values - are: "Add", "Remove", "Reset", and "EnableCommunity". - :paramtype operation_type: str or - ~azure.mgmt.compute.v2022_03_03.models.SharingUpdateOperationTypes - :keyword groups: A list of sharing profile groups. - :paramtype groups: list[~azure.mgmt.compute.v2022_03_03.models.SharingProfileGroup] - """ - super().__init__(**kwargs) - self.operation_type = operation_type - self.groups = groups - - -class SoftDeletePolicy(_serialization.Model): - """Contains information about the soft deletion policy of the gallery. - - :ivar is_soft_delete_enabled: Enables soft-deletion for resources in this gallery, allowing - them to be recovered within retention time. - :vartype is_soft_delete_enabled: bool - """ - - _attribute_map = { - "is_soft_delete_enabled": {"key": "isSoftDeleteEnabled", "type": "bool"}, - } - - def __init__(self, *, is_soft_delete_enabled: Optional[bool] = None, **kwargs): - """ - :keyword is_soft_delete_enabled: Enables soft-deletion for resources in this gallery, allowing - them to be recovered within retention time. - :paramtype is_soft_delete_enabled: bool - """ - super().__init__(**kwargs) - self.is_soft_delete_enabled = is_soft_delete_enabled - - -class TargetRegion(_serialization.Model): - """Describes the target region information. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the region. Required. - :vartype name: str - :ivar regional_replica_count: The number of replicas of the Image Version to be created per - region. This property is updatable. - :vartype regional_replica_count: int - :ivar storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Known values are: "Standard_LRS", "Standard_ZRS", and - "Premium_LRS". - :vartype storage_account_type: str or ~azure.mgmt.compute.v2022_03_03.models.StorageAccountType - :ivar encryption: Optional. Allows users to provide customer managed keys for encrypting the OS - and data disks in the gallery artifact. - :vartype encryption: ~azure.mgmt.compute.v2022_03_03.models.EncryptionImages - :ivar exclude_from_latest: Contains the flag setting to hide an image when users specify - version='latest'. - :vartype exclude_from_latest: bool - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "regional_replica_count": {"key": "regionalReplicaCount", "type": "int"}, - "storage_account_type": {"key": "storageAccountType", "type": "str"}, - "encryption": {"key": "encryption", "type": "EncryptionImages"}, - "exclude_from_latest": {"key": "excludeFromLatest", "type": "bool"}, - } - - def __init__( - self, - *, - name: str, - regional_replica_count: Optional[int] = None, - storage_account_type: Optional[Union[str, "_models.StorageAccountType"]] = None, - encryption: Optional["_models.EncryptionImages"] = None, - exclude_from_latest: Optional[bool] = None, - **kwargs - ): - """ - :keyword name: The name of the region. Required. - :paramtype name: str - :keyword regional_replica_count: The number of replicas of the Image Version to be created per - region. This property is updatable. - :paramtype regional_replica_count: int - :keyword storage_account_type: Specifies the storage account type to be used to store the - image. This property is not updatable. Known values are: "Standard_LRS", "Standard_ZRS", and - "Premium_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.compute.v2022_03_03.models.StorageAccountType - :keyword encryption: Optional. Allows users to provide customer managed keys for encrypting the - OS and data disks in the gallery artifact. - :paramtype encryption: ~azure.mgmt.compute.v2022_03_03.models.EncryptionImages - :keyword exclude_from_latest: Contains the flag setting to hide an image when users specify - version='latest'. - :paramtype exclude_from_latest: bool - """ - super().__init__(**kwargs) - self.name = name - self.regional_replica_count = regional_replica_count - self.storage_account_type = storage_account_type - self.encryption = encryption - self.exclude_from_latest = exclude_from_latest - - -class UserArtifactManage(_serialization.Model): - """UserArtifactManage. - - All required parameters must be populated in order to send to Azure. - - :ivar install: Required. The path and arguments to install the gallery application. This is - limited to 4096 characters. Required. - :vartype install: str - :ivar remove: Required. The path and arguments to remove the gallery application. This is - limited to 4096 characters. Required. - :vartype remove: str - :ivar update: Optional. The path and arguments to update the gallery application. If not - present, then update operation will invoke remove command on the previous version and install - command on the current version of the gallery application. This is limited to 4096 characters. - :vartype update: str - """ - - _validation = { - "install": {"required": True}, - "remove": {"required": True}, - } - - _attribute_map = { - "install": {"key": "install", "type": "str"}, - "remove": {"key": "remove", "type": "str"}, - "update": {"key": "update", "type": "str"}, - } - - def __init__(self, *, install: str, remove: str, update: Optional[str] = None, **kwargs): - """ - :keyword install: Required. The path and arguments to install the gallery application. This is - limited to 4096 characters. Required. - :paramtype install: str - :keyword remove: Required. The path and arguments to remove the gallery application. This is - limited to 4096 characters. Required. - :paramtype remove: str - :keyword update: Optional. The path and arguments to update the gallery application. If not - present, then update operation will invoke remove command on the previous version and install - command on the current version of the gallery application. This is limited to 4096 characters. - :paramtype update: str - """ - super().__init__(**kwargs) - self.install = install - self.remove = remove - self.update = update - - -class UserArtifactSettings(_serialization.Model): - """Additional settings for the VM app that contains the target package and config file name when it is deployed to target VM or VM scale set. - - :ivar package_file_name: Optional. The name to assign the downloaded package file on the VM. - This is limited to 4096 characters. If not specified, the package file will be named the same - as the Gallery Application name. - :vartype package_file_name: str - :ivar config_file_name: Optional. The name to assign the downloaded config file on the VM. This - is limited to 4096 characters. If not specified, the config file will be named the Gallery - Application name appended with "_config". - :vartype config_file_name: str - """ - - _attribute_map = { - "package_file_name": {"key": "packageFileName", "type": "str"}, - "config_file_name": {"key": "configFileName", "type": "str"}, - } - - def __init__(self, *, package_file_name: Optional[str] = None, config_file_name: Optional[str] = None, **kwargs): - """ - :keyword package_file_name: Optional. The name to assign the downloaded package file on the VM. - This is limited to 4096 characters. If not specified, the package file will be named the same - as the Gallery Application name. - :paramtype package_file_name: str - :keyword config_file_name: Optional. The name to assign the downloaded config file on the VM. - This is limited to 4096 characters. If not specified, the config file will be named the Gallery - Application name appended with "_config". - :paramtype config_file_name: str - """ - super().__init__(**kwargs) - self.package_file_name = package_file_name - self.config_file_name = config_file_name - - -class UserArtifactSource(_serialization.Model): - """The source image from which the Image Version is going to be created. - - All required parameters must be populated in order to send to Azure. - - :ivar media_link: Required. The mediaLink of the artifact, must be a readable storage page - blob. Required. - :vartype media_link: str - :ivar default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must - be a readable storage page blob. - :vartype default_configuration_link: str - """ - - _validation = { - "media_link": {"required": True}, - } - - _attribute_map = { - "media_link": {"key": "mediaLink", "type": "str"}, - "default_configuration_link": {"key": "defaultConfigurationLink", "type": "str"}, - } - - def __init__(self, *, media_link: str, default_configuration_link: Optional[str] = None, **kwargs): - """ - :keyword media_link: Required. The mediaLink of the artifact, must be a readable storage page - blob. Required. - :paramtype media_link: str - :keyword default_configuration_link: Optional. The defaultConfigurationLink of the artifact, - must be a readable storage page blob. - :paramtype default_configuration_link: str - """ - super().__init__(**kwargs) - self.media_link = media_link - self.default_configuration_link = default_configuration_link diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_patch.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/__init__.py deleted file mode 100644 index aa7e32324e0e..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/__init__.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 ._galleries_operations import GalleriesOperations -from ._gallery_images_operations import GalleryImagesOperations -from ._gallery_image_versions_operations import GalleryImageVersionsOperations -from ._gallery_applications_operations import GalleryApplicationsOperations -from ._gallery_application_versions_operations import GalleryApplicationVersionsOperations -from ._gallery_sharing_profile_operations import GallerySharingProfileOperations -from ._shared_galleries_operations import SharedGalleriesOperations -from ._shared_gallery_images_operations import SharedGalleryImagesOperations -from ._shared_gallery_image_versions_operations import SharedGalleryImageVersionsOperations -from ._community_galleries_operations import CommunityGalleriesOperations -from ._community_gallery_images_operations import CommunityGalleryImagesOperations -from ._community_gallery_image_versions_operations import CommunityGalleryImageVersionsOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "GalleriesOperations", - "GalleryImagesOperations", - "GalleryImageVersionsOperations", - "GalleryApplicationsOperations", - "GalleryApplicationVersionsOperations", - "GallerySharingProfileOperations", - "SharedGalleriesOperations", - "SharedGalleryImagesOperations", - "SharedGalleryImageVersionsOperations", - "CommunityGalleriesOperations", - "CommunityGalleryImagesOperations", - "CommunityGalleryImageVersionsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_galleries_operations.py deleted file mode 100644 index 5de3ad7e27b9..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_galleries_operations.py +++ /dev/null @@ -1,141 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request(location: str, public_gallery_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "publicGalleryName": _SERIALIZER.url("public_gallery_name", public_gallery_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class CommunityGalleriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`community_galleries` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, location: str, public_gallery_name: str, **kwargs: Any) -> _models.CommunityGallery: - """Get a community gallery by gallery public name. - - :param location: Resource location. Required. - :type location: str - :param public_gallery_name: The public name of the community gallery. Required. - :type public_gallery_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CommunityGallery or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.CommunityGallery - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGallery] - - request = build_get_request( - location=location, - public_gallery_name=public_gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CommunityGallery", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_image_versions_operations.py deleted file mode 100644 index b926e22c8936..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_image_versions_operations.py +++ /dev/null @@ -1,292 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - location: str, - public_gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "publicGalleryName": _SERIALIZER.url("public_gallery_name", public_gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - "galleryImageVersionName": _SERIALIZER.url("gallery_image_version_name", gallery_image_version_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_request( - location: str, public_gallery_name: str, gallery_image_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "publicGalleryName": _SERIALIZER.url("public_gallery_name", public_gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class CommunityGalleryImageVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`community_gallery_image_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - location: str, - public_gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - **kwargs: Any - ) -> _models.CommunityGalleryImageVersion: - """Get a community gallery image version. - - :param location: Resource location. Required. - :type location: str - :param public_gallery_name: The public name of the community gallery. Required. - :type public_gallery_name: str - :param gallery_image_name: The name of the community gallery image definition. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the community gallery image version. Needs to - follow semantic version name pattern: The allowed characters are digit and period. Digits must - be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CommunityGalleryImageVersion or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImageVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersion] - - request = build_get_request( - location=location, - public_gallery_name=public_gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CommunityGalleryImageVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @distributed_trace - def list( - self, location: str, public_gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> Iterable["_models.CommunityGalleryImageVersion"]: - """List community gallery image versions inside an image. - - :param location: Resource location. Required. - :type location: str - :param public_gallery_name: The public name of the community gallery. Required. - :type public_gallery_name: str - :param gallery_image_name: The name of the community gallery image definition. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CommunityGalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersionList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - location=location, - public_gallery_name=public_gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CommunityGalleryImageVersionList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_images_operations.py deleted file mode 100644 index 2b450bc117d0..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_images_operations.py +++ /dev/null @@ -1,267 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - location: str, public_gallery_name: str, gallery_image_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "publicGalleryName": _SERIALIZER.url("public_gallery_name", public_gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_request(location: str, public_gallery_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "publicGalleryName": _SERIALIZER.url("public_gallery_name", public_gallery_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class CommunityGalleryImagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`community_gallery_images` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, location: str, public_gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> _models.CommunityGalleryImage: - """Get a community gallery image. - - :param location: Resource location. Required. - :type location: str - :param public_gallery_name: The public name of the community gallery. Required. - :type public_gallery_name: str - :param gallery_image_name: The name of the community gallery image definition. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CommunityGalleryImage or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImage - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImage] - - request = build_get_request( - location=location, - public_gallery_name=public_gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CommunityGalleryImage", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}"} # type: ignore - - @distributed_trace - def list(self, location: str, public_gallery_name: str, **kwargs: Any) -> Iterable["_models.CommunityGalleryImage"]: - """List community gallery images inside a gallery. - - :param location: Resource location. Required. - :type location: str - :param public_gallery_name: The public name of the community gallery. Required. - :type public_gallery_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CommunityGalleryImage or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.CommunityGalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - location=location, - public_gallery_name=public_gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CommunityGalleryImageList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_galleries_operations.py deleted file mode 100644 index d55fd27ac376..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_galleries_operations.py +++ /dev/null @@ -1,1014 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, gallery_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, gallery_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - gallery_name: str, - subscription_id: str, - *, - select: Optional[Union[str, _models.SelectPermissions]] = None, - expand: Optional[Union[str, _models.GalleryExpandParams]] = None, - **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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, gallery_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class GalleriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`galleries` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_or_update_initial( - self, resource_group_name: str, gallery_name: str, gallery: Union[_models.Gallery, IO], **kwargs: Any - ) -> _models.Gallery: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery, (IO, bytes)): - _content = gallery - else: - _json = self._serialize.body(gallery, "Gallery") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Gallery", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("Gallery", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Gallery", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery: _models.Gallery, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Gallery]: - """Create or update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. - Required. - :type gallery: ~azure.mgmt.compute.v2022_03_03.models.Gallery - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Gallery or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Gallery]: - """Create or update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. - Required. - :type gallery: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Gallery or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, resource_group_name: str, gallery_name: str, gallery: Union[_models.Gallery, IO], **kwargs: Any - ) -> LROPoller[_models.Gallery]: - """Create or update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. Is - either a model type or a IO type. Required. - :type gallery: ~azure.mgmt.compute.v2022_03_03.models.Gallery or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Gallery or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery=gallery, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Gallery", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - def _update_initial( - self, resource_group_name: str, gallery_name: str, gallery: Union[_models.GalleryUpdate, IO], **kwargs: Any - ) -> _models.Gallery: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery, (IO, bytes)): - _content = gallery - else: - _json = self._serialize.body(gallery, "GalleryUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Gallery", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery: _models.GalleryUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Gallery]: - """Update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the update Shared Image Gallery operation. Required. - :type gallery: ~azure.mgmt.compute.v2022_03_03.models.GalleryUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Gallery or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Gallery]: - """Update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the update Shared Image Gallery operation. Required. - :type gallery: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Gallery or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, resource_group_name: str, gallery_name: str, gallery: Union[_models.GalleryUpdate, IO], **kwargs: Any - ) -> LROPoller[_models.Gallery]: - """Update a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets - and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. - Required. - :type gallery_name: str - :param gallery: Parameters supplied to the update Shared Image Gallery operation. Is either a - model type or a IO type. Required. - :type gallery: ~azure.mgmt.compute.v2022_03_03.models.GalleryUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Gallery or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery=gallery, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Gallery", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - gallery_name: str, - select: Optional[Union[str, _models.SelectPermissions]] = None, - expand: Optional[Union[str, _models.GalleryExpandParams]] = None, - **kwargs: Any - ) -> _models.Gallery: - """Retrieves information about a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. Required. - :type gallery_name: str - :param select: The select expression to apply on the operation. "Permissions" Default value is - None. - :type select: str or ~azure.mgmt.compute.v2022_03_03.models.SelectPermissions - :param expand: The expand query option to apply on the operation. "SharingProfile/Groups" - Default value is None. - :type expand: str or ~azure.mgmt.compute.v2022_03_03.models.GalleryExpandParams - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Gallery or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.Gallery - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - - request = build_get_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - select=select, - expand=expand, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Gallery", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, gallery_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a Shared Image Gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery to be deleted. Required. - :type gallery_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"} # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Gallery"]: - """List galleries under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Gallery or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries"} # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: - """List galleries under a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Gallery or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.Gallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_application_versions_operations.py deleted file mode 100644 index 40336d2ad725..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_application_versions_operations.py +++ /dev/null @@ -1,1086 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryApplicationName": _SERIALIZER.url("gallery_application_name", gallery_application_name, "str"), - "galleryApplicationVersionName": _SERIALIZER.url( - "gallery_application_version_name", gallery_application_version_name, "str" - ), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryApplicationName": _SERIALIZER.url("gallery_application_name", gallery_application_name, "str"), - "galleryApplicationVersionName": _SERIALIZER.url( - "gallery_application_version_name", gallery_application_version_name, "str" - ), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - subscription_id: str, - *, - expand: Optional[Union[str, _models.ReplicationStatusTypes]] = None, - **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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryApplicationName": _SERIALIZER.url("gallery_application_name", gallery_application_name, "str"), - "galleryApplicationVersionName": _SERIALIZER.url( - "gallery_application_version_name", gallery_application_version_name, "str" - ), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryApplicationName": _SERIALIZER.url("gallery_application_name", gallery_application_name, "str"), - "galleryApplicationVersionName": _SERIALIZER.url( - "gallery_application_version_name", gallery_application_version_name, "str" - ), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_gallery_application_request( - resource_group_name: str, gallery_name: str, gallery_application_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryApplicationName": _SERIALIZER.url("gallery_application_name", gallery_application_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class GalleryApplicationVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`gallery_application_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_or_update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: Union[_models.GalleryApplicationVersion, IO], - **kwargs: Any - ) -> _models.GalleryApplicationVersion: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_application_version, (IO, bytes)): - _content = gallery_application_version - else: - _json = self._serialize.body(gallery_application_version, "GalleryApplicationVersion") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: _models.GalleryApplicationVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryApplicationVersion]: - """Create or update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. Required. - :type gallery_application_version: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplicationVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryApplicationVersion]: - """Create or update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. Required. - :type gallery_application_version: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplicationVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: Union[_models.GalleryApplicationVersion, IO], - **kwargs: Any - ) -> LROPoller[_models.GalleryApplicationVersion]: - """Create or update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be created. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - created. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the create or update gallery - Application Version operation. Is either a model type or a IO type. Required. - :type gallery_application_version: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplicationVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - gallery_application_version=gallery_application_version, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - def _update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: Union[_models.GalleryApplicationVersionUpdate, IO], - **kwargs: Any - ) -> _models.GalleryApplicationVersion: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_application_version, (IO, bytes)): - _content = gallery_application_version - else: - _json = self._serialize.body(gallery_application_version, "GalleryApplicationVersionUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: _models.GalleryApplicationVersionUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryApplicationVersion]: - """Update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be updated. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - updated. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the update gallery Application - Version operation. Required. - :type gallery_application_version: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplicationVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryApplicationVersion]: - """Update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be updated. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - updated. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the update gallery Application - Version operation. Required. - :type gallery_application_version: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplicationVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - gallery_application_version: Union[_models.GalleryApplicationVersionUpdate, IO], - **kwargs: Any - ) -> LROPoller[_models.GalleryApplicationVersion]: - """Update a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version is to be updated. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - updated. Needs to follow semantic version name pattern: The allowed characters are digit and - period. Digits must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_application_version_name: str - :param gallery_application_version: Parameters supplied to the update gallery Application - Version operation. Is either a model type or a IO type. Required. - :type gallery_application_version: - ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersionUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplicationVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - gallery_application_version=gallery_application_version, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - expand: Optional[Union[str, _models.ReplicationStatusTypes]] = None, - **kwargs: Any - ) -> _models.GalleryApplicationVersion: - """Retrieves information about a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version resides. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - retrieved. Required. - :type gallery_application_version_name: str - :param expand: The expand expression to apply on the operation. "ReplicationStatus" Default - value is None. - :type expand: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationStatusTypes - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GalleryApplicationVersion or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] - - request = build_get_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryApplicationVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application_version_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Delete a gallery Application Version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition in which the - Application Version resides. Required. - :type gallery_application_name: str - :param gallery_application_version_name: The name of the gallery Application Version to be - deleted. Required. - :type gallery_application_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application_version_name=gallery_application_version_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"} # type: ignore - - @distributed_trace - def list_by_gallery_application( - self, resource_group_name: str, gallery_name: str, gallery_application_name: str, **kwargs: Any - ) -> Iterable["_models.GalleryApplicationVersion"]: - """List gallery Application Versions in a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition resides. Required. - :type gallery_name: str - :param gallery_application_name: The name of the Shared Application Gallery Application - Definition from which the Application Versions are to be listed. Required. - :type gallery_application_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either GalleryApplicationVersion or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_gallery_application_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_gallery_application.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryApplicationVersionList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_gallery_application.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_applications_operations.py deleted file mode 100644 index 62887799864b..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_applications_operations.py +++ /dev/null @@ -1,975 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, gallery_name: str, gallery_application_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryApplicationName": _SERIALIZER.url("gallery_application_name", gallery_application_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, gallery_name: str, gallery_application_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryApplicationName": _SERIALIZER.url("gallery_application_name", gallery_application_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, gallery_name: str, gallery_application_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryApplicationName": _SERIALIZER.url("gallery_application_name", gallery_application_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, gallery_name: str, gallery_application_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryApplicationName": _SERIALIZER.url("gallery_application_name", gallery_application_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_gallery_request( - resource_group_name: str, gallery_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class GalleryApplicationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`gallery_applications` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_or_update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: Union[_models.GalleryApplication, IO], - **kwargs: Any - ) -> _models.GalleryApplication: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_application, (IO, bytes)): - _content = gallery_application - else: - _json = self._serialize.body(gallery_application, "GalleryApplication") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("GalleryApplication", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("GalleryApplication", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("GalleryApplication", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: _models.GalleryApplication, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryApplication]: - """Create or update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the create or update gallery Application - operation. Required. - :type gallery_application: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplication - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryApplication]: - """Create or update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the create or update gallery Application - operation. Required. - :type gallery_application: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: Union[_models.GalleryApplication, IO], - **kwargs: Any - ) -> LROPoller[_models.GalleryApplication]: - """Create or update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be created. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be created - or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods - allowed in the middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the create or update gallery Application - operation. Is either a model type or a IO type. Required. - :type gallery_application: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplication or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application=gallery_application, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryApplication", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - def _update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: Union[_models.GalleryApplicationUpdate, IO], - **kwargs: Any - ) -> _models.GalleryApplication: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_application, (IO, bytes)): - _content = gallery_application - else: - _json = self._serialize.body(gallery_application, "GalleryApplicationUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryApplication", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: _models.GalleryApplicationUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryApplication]: - """Update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be updated. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the update gallery Application operation. - Required. - :type gallery_application: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryApplication]: - """Update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be updated. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the update gallery Application operation. - Required. - :type gallery_application: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_application_name: str, - gallery_application: Union[_models.GalleryApplicationUpdate, IO], - **kwargs: Any - ) -> LROPoller[_models.GalleryApplication]: - """Update a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be updated. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_application_name: str - :param gallery_application: Parameters supplied to the update gallery Application operation. Is - either a model type or a IO type. Required. - :type gallery_application: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplicationUpdate or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryApplication or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - gallery_application=gallery_application, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryApplication", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, gallery_name: str, gallery_application_name: str, **kwargs: Any - ) -> _models.GalleryApplication: - """Retrieves information about a gallery Application Definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery from which the Application - Definitions are to be retrieved. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be - retrieved. Required. - :type gallery_application_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GalleryApplication or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.GalleryApplication - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] - - request = build_get_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryApplication", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, gallery_name: str, gallery_application_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, gallery_name: str, gallery_application_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a gallery Application. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery in which the Application - Definition is to be deleted. Required. - :type gallery_name: str - :param gallery_application_name: The name of the gallery Application Definition to be deleted. - Required. - :type gallery_application_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_application_name=gallery_application_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"} # type: ignore - - @distributed_trace - def list_by_gallery( - self, resource_group_name: str, gallery_name: str, **kwargs: Any - ) -> Iterable["_models.GalleryApplication"]: - """List gallery Application Definitions in a gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Application Gallery from which Application - Definitions are to be listed. Required. - :type gallery_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either GalleryApplication or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.GalleryApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_gallery_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_gallery.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryApplicationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_gallery.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_image_versions_operations.py deleted file mode 100644 index 0132a5b51d79..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_image_versions_operations.py +++ /dev/null @@ -1,1074 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - "galleryImageVersionName": _SERIALIZER.url("gallery_image_version_name", gallery_image_version_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - "galleryImageVersionName": _SERIALIZER.url("gallery_image_version_name", gallery_image_version_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - subscription_id: str, - *, - expand: Optional[Union[str, _models.ReplicationStatusTypes]] = None, - **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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - "galleryImageVersionName": _SERIALIZER.url("gallery_image_version_name", gallery_image_version_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - "galleryImageVersionName": _SERIALIZER.url("gallery_image_version_name", gallery_image_version_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_gallery_image_request( - resource_group_name: str, gallery_name: str, gallery_image_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class GalleryImageVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`gallery_image_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_or_update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: Union[_models.GalleryImageVersion, IO], - **kwargs: Any - ) -> _models.GalleryImageVersion: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_image_version, (IO, bytes)): - _content = gallery_image_version - else: - _json = self._serialize.body(gallery_image_version, "GalleryImageVersion") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: _models.GalleryImageVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryImageVersion]: - """Create or update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be created. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the create or update gallery image version - operation. Required. - :type gallery_image_version: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryImageVersion]: - """Create or update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be created. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the create or update gallery image version - operation. Required. - :type gallery_image_version: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: Union[_models.GalleryImageVersion, IO], - **kwargs: Any - ) -> LROPoller[_models.GalleryImageVersion]: - """Create or update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be created. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the create or update gallery image version - operation. Is either a model type or a IO type. Required. - :type gallery_image_version: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - gallery_image_version=gallery_image_version, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - def _update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: Union[_models.GalleryImageVersionUpdate, IO], - **kwargs: Any - ) -> _models.GalleryImageVersion: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_image_version, (IO, bytes)): - _content = gallery_image_version - else: - _json = self._serialize.body(gallery_image_version, "GalleryImageVersionUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: _models.GalleryImageVersionUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryImageVersion]: - """Update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be updated. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be updated. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the update gallery image version - operation. Required. - :type gallery_image_version: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryImageVersion]: - """Update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be updated. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be updated. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the update gallery image version - operation. Required. - :type gallery_image_version: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - gallery_image_version: Union[_models.GalleryImageVersionUpdate, IO], - **kwargs: Any - ) -> LROPoller[_models.GalleryImageVersion]: - """Update a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - is to be updated. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be updated. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :param gallery_image_version: Parameters supplied to the update gallery image version - operation. Is either a model type or a IO type. Required. - :type gallery_image_version: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersionUpdate - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - gallery_image_version=gallery_image_version, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - expand: Optional[Union[str, _models.ReplicationStatusTypes]] = None, - **kwargs: Any - ) -> _models.GalleryImageVersion: - """Retrieves information about a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - resides. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be retrieved. - Required. - :type gallery_image_version_name: str - :param expand: The expand expression to apply on the operation. "ReplicationStatus" Default - value is None. - :type expand: str or ~azure.mgmt.compute.v2022_03_03.models.ReplicationStatusTypes - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GalleryImageVersion or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] - - request = build_get_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryImageVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Delete a gallery image version. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition in which the Image Version - resides. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be deleted. - Required. - :type gallery_image_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore - - @distributed_trace - def list_by_gallery_image( - self, resource_group_name: str, gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> Iterable["_models.GalleryImageVersion"]: - """List gallery image versions in a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition - resides. Required. - :type gallery_name: str - :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the - Image Versions are to be listed. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either GalleryImageVersion or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.GalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_gallery_image_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_gallery_image.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryImageVersionList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_gallery_image.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_images_operations.py deleted file mode 100644 index 38096f8d6114..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_images_operations.py +++ /dev/null @@ -1,964 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, gallery_name: str, gallery_image_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, gallery_name: str, gallery_image_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, gallery_name: str, gallery_image_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, gallery_name: str, gallery_image_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_gallery_request( - resource_group_name: str, gallery_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class GalleryImagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`gallery_images` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_or_update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: Union[_models.GalleryImage, IO], - **kwargs: Any - ) -> _models.GalleryImage: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_image, (IO, bytes)): - _content = gallery_image - else: - _json = self._serialize.body(gallery_image, "GalleryImage") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("GalleryImage", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("GalleryImage", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("GalleryImage", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: _models.GalleryImage, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryImage]: - """Create or update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the create or update gallery image operation. - Required. - :type gallery_image: ~azure.mgmt.compute.v2022_03_03.models.GalleryImage - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryImage]: - """Create or update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the create or update gallery image operation. - Required. - :type gallery_image: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: Union[_models.GalleryImage, IO], - **kwargs: Any - ) -> LROPoller[_models.GalleryImage]: - """Create or update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be created. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be created or updated. - The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the - middle. The maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the create or update gallery image operation. Is - either a model type or a IO type. Required. - :type gallery_image: ~azure.mgmt.compute.v2022_03_03.models.GalleryImage or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image=gallery_image, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryImage", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - def _update_initial( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: Union[_models.GalleryImageUpdate, IO], - **kwargs: Any - ) -> _models.GalleryImage: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(gallery_image, (IO, bytes)): - _content = gallery_image - else: - _json = self._serialize.body(gallery_image, "GalleryImageUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryImage", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: _models.GalleryImageUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryImage]: - """Update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be updated. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be updated. The allowed - characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the update gallery image operation. Required. - :type gallery_image: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GalleryImage]: - """Update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be updated. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be updated. The allowed - characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the update gallery image operation. Required. - :type gallery_image: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - gallery_image_name: str, - gallery_image: Union[_models.GalleryImageUpdate, IO], - **kwargs: Any - ) -> LROPoller[_models.GalleryImage]: - """Update a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be updated. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be updated. The allowed - characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - maximum length is 80 characters. Required. - :type gallery_image_name: str - :param gallery_image: Parameters supplied to the update gallery image operation. Is either a - model type or a IO type. Required. - :type gallery_image: ~azure.mgmt.compute.v2022_03_03.models.GalleryImageUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either GalleryImage or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - gallery_image=gallery_image, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GalleryImage", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> _models.GalleryImage: - """Retrieves information about a gallery image definition. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery from which the Image Definitions are - to be retrieved. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be retrieved. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GalleryImage or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.GalleryImage - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] - - request = build_get_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GalleryImage", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, gallery_name: str, gallery_image_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a gallery image. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to - be deleted. Required. - :type gallery_name: str - :param gallery_image_name: The name of the gallery image definition to be deleted. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - gallery_image_name=gallery_image_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"} # type: ignore - - @distributed_trace - def list_by_gallery( - self, resource_group_name: str, gallery_name: str, **kwargs: Any - ) -> Iterable["_models.GalleryImage"]: - """List gallery image definitions in a gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to - be listed. Required. - :type gallery_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either GalleryImage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.GalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_gallery_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_gallery.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GalleryImageList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_gallery.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_sharing_profile_operations.py deleted file mode 100644 index eb1b6b3fdb8b..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_sharing_profile_operations.py +++ /dev/null @@ -1,307 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_update_request( - resource_group_name: str, gallery_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class GallerySharingProfileOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`gallery_sharing_profile` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _update_initial( - self, - resource_group_name: str, - gallery_name: str, - sharing_update: Union[_models.SharingUpdate, IO], - **kwargs: Any - ) -> _models.SharingUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(sharing_update, (IO, bytes)): - _content = sharing_update - else: - _json = self._serialize.body(sharing_update, "SharingUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - gallery_name=gallery_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("SharingUpdate", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("SharingUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share"} # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - sharing_update: _models.SharingUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SharingUpdate]: - """Update sharing profile of a gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. Required. - :type gallery_name: str - :param sharing_update: Parameters supplied to the update gallery sharing profile. Required. - :type sharing_update: ~azure.mgmt.compute.v2022_03_03.models.SharingUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either SharingUpdate or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.SharingUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - sharing_update: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SharingUpdate]: - """Update sharing profile of a gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. Required. - :type gallery_name: str - :param sharing_update: Parameters supplied to the update gallery sharing profile. Required. - :type sharing_update: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either SharingUpdate or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.SharingUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - gallery_name: str, - sharing_update: Union[_models.SharingUpdate, IO], - **kwargs: Any - ) -> LROPoller[_models.SharingUpdate]: - """Update sharing profile of a gallery. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param gallery_name: The name of the Shared Image Gallery. Required. - :type gallery_name: str - :param sharing_update: Parameters supplied to the update gallery sharing profile. Is either a - model type or a IO type. Required. - :type sharing_update: ~azure.mgmt.compute.v2022_03_03.models.SharingUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either SharingUpdate or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_03_03.models.SharingUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-03-03")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( # type: ignore - resource_group_name=resource_group_name, - gallery_name=gallery_name, - sharing_update=sharing_update, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SharingUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_patch.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_galleries_operations.py deleted file mode 100644 index 3309f4cf2bc9..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_galleries_operations.py +++ /dev/null @@ -1,267 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - location: str, - subscription_id: str, - *, - shared_to: Optional[Union[str, _models.SharedToValues]] = None, - **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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if shared_to is not None: - _params["sharedTo"] = _SERIALIZER.query("shared_to", shared_to, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location: str, gallery_unique_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "galleryUniqueName": _SERIALIZER.url("gallery_unique_name", gallery_unique_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SharedGalleriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`shared_galleries` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, location: str, shared_to: Optional[Union[str, _models.SharedToValues]] = None, **kwargs: Any - ) -> Iterable["_models.SharedGallery"]: - """List shared galleries by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param shared_to: The query parameter to decide what shared galleries to fetch when doing - listing operations. "tenant" Default value is None. - :type shared_to: str or ~azure.mgmt.compute.v2022_03_03.models.SharedToValues - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SharedGallery or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.SharedGallery] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - shared_to=shared_to, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SharedGalleryList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries"} # type: ignore - - @distributed_trace - def get(self, location: str, gallery_unique_name: str, **kwargs: Any) -> _models.SharedGallery: - """Get a shared gallery by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param gallery_unique_name: The unique name of the Shared Gallery. Required. - :type gallery_unique_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SharedGallery or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.SharedGallery - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] - - request = build_get_request( - location=location, - gallery_unique_name=gallery_unique_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SharedGallery", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_image_versions_operations.py deleted file mode 100644 index 2f613c7f54f7..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_image_versions_operations.py +++ /dev/null @@ -1,311 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - location: str, - gallery_unique_name: str, - gallery_image_name: str, - subscription_id: str, - *, - shared_to: Optional[Union[str, _models.SharedToValues]] = None, - **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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "galleryUniqueName": _SERIALIZER.url("gallery_unique_name", gallery_unique_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if shared_to is not None: - _params["sharedTo"] = _SERIALIZER.query("shared_to", shared_to, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - location: str, - gallery_unique_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "galleryUniqueName": _SERIALIZER.url("gallery_unique_name", gallery_unique_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - "galleryImageVersionName": _SERIALIZER.url("gallery_image_version_name", gallery_image_version_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SharedGalleryImageVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`shared_gallery_image_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - location: str, - gallery_unique_name: str, - gallery_image_name: str, - shared_to: Optional[Union[str, _models.SharedToValues]] = None, - **kwargs: Any - ) -> Iterable["_models.SharedGalleryImageVersion"]: - """List shared gallery image versions by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param gallery_unique_name: The unique name of the Shared Gallery. Required. - :type gallery_unique_name: str - :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image - Versions are to be listed. Required. - :type gallery_image_name: str - :param shared_to: The query parameter to decide what shared galleries to fetch when doing - listing operations. "tenant" Default value is None. - :type shared_to: str or ~azure.mgmt.compute.v2022_03_03.models.SharedToValues - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SharedGalleryImageVersion or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - location=location, - gallery_unique_name=gallery_unique_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - shared_to=shared_to, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SharedGalleryImageVersionList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions"} # type: ignore - - @distributed_trace - def get( - self, - location: str, - gallery_unique_name: str, - gallery_image_name: str, - gallery_image_version_name: str, - **kwargs: Any - ) -> _models.SharedGalleryImageVersion: - """Get a shared gallery image version by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param gallery_unique_name: The unique name of the Shared Gallery. Required. - :type gallery_unique_name: str - :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image - Versions are to be listed. Required. - :type gallery_image_name: str - :param gallery_image_version_name: The name of the gallery image version to be created. Needs - to follow semantic version name pattern: The allowed characters are digit and period. Digits - must be within the range of a 32-bit integer. Format: - :code:``.:code:``.:code:``. Required. - :type gallery_image_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SharedGalleryImageVersion or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImageVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] - - request = build_get_request( - location=location, - gallery_unique_name=gallery_unique_name, - gallery_image_name=gallery_image_name, - gallery_image_version_name=gallery_image_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SharedGalleryImageVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_images_operations.py deleted file mode 100644 index 9740fb558790..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_images_operations.py +++ /dev/null @@ -1,285 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - location: str, - gallery_unique_name: str, - subscription_id: str, - *, - shared_to: Optional[Union[str, _models.SharedToValues]] = None, - **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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "galleryUniqueName": _SERIALIZER.url("gallery_unique_name", gallery_unique_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if shared_to is not None: - _params["sharedTo"] = _SERIALIZER.query("shared_to", shared_to, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - location: str, gallery_unique_name: str, gallery_image_name: str, 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", _params.pop("api-version", "2022-03-03")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "galleryUniqueName": _SERIALIZER.url("gallery_unique_name", gallery_unique_name, "str"), - "galleryImageName": _SERIALIZER.url("gallery_image_name", gallery_image_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SharedGalleryImagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_03_03.ComputeManagementClient`'s - :attr:`shared_gallery_images` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - location: str, - gallery_unique_name: str, - shared_to: Optional[Union[str, _models.SharedToValues]] = None, - **kwargs: Any - ) -> Iterable["_models.SharedGalleryImage"]: - """List shared gallery images by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param gallery_unique_name: The unique name of the Shared Gallery. Required. - :type gallery_unique_name: str - :param shared_to: The query parameter to decide what shared galleries to fetch when doing - listing operations. "tenant" Default value is None. - :type shared_to: str or ~azure.mgmt.compute.v2022_03_03.models.SharedToValues - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SharedGalleryImage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - location=location, - gallery_unique_name=gallery_unique_name, - subscription_id=self._config.subscription_id, - shared_to=shared_to, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SharedGalleryImageList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images"} # type: ignore - - @distributed_trace - def get( - self, location: str, gallery_unique_name: str, gallery_image_name: str, **kwargs: Any - ) -> _models.SharedGalleryImage: - """Get a shared gallery image by subscription id or tenant id. - - :param location: Resource location. Required. - :type location: str - :param gallery_unique_name: The unique name of the Shared Gallery. Required. - :type gallery_unique_name: str - :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image - Versions are to be listed. Required. - :type gallery_image_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SharedGalleryImage or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_03_03.models.SharedGalleryImage - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] - - request = build_get_request( - location=location, - gallery_unique_name=gallery_unique_name, - gallery_image_name=gallery_image_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SharedGalleryImage", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/py.typed b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_configuration.py index 5b1fdf28b114..68d1330c6ff9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-04-04") # type: str + api_version = kwargs.pop("api_version", "2022-04-04") # type: Literal["2022-04-04"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_metadata.json index 9be6b0557db5..aecd339a2468 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_metadata.json @@ -103,4 +103,4 @@ "cloud_services_update_domain": "CloudServicesUpdateDomainOperations", "cloud_service_operating_systems": "CloudServiceOperatingSystemsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/_configuration.py index 556d4e3f0411..c912b60ef2ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-04-04") # type: str + api_version = kwargs.pop("api_version", "2022-04-04") # type: Literal["2022-04-04"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_operating_systems_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_operating_systems_operations.py index f7e658d1f27b..7f5fb3318e52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_operating_systems_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_operating_systems_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -35,6 +36,10 @@ build_list_os_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ async def get_os_version(self, location: str, os_version_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersion] request = build_get_os_version_request( @@ -134,7 +139,7 @@ def list_os_versions(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersionListResult] error_map = { @@ -227,7 +232,7 @@ async def get_os_family(self, location: str, os_family_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamily] request = build_get_os_family_request( @@ -278,7 +283,7 @@ def list_os_families(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamilyListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_role_instances_operations.py index c2d882919190..87e8b37cb69e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -41,6 +42,10 @@ build_restart_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -136,7 +141,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -211,7 +216,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -275,7 +280,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -338,7 +343,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -422,7 +427,7 @@ async def _restart_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -481,7 +486,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -534,7 +539,7 @@ async def _reimage_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -593,7 +598,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -646,7 +651,7 @@ async def _rebuild_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -706,7 +711,7 @@ async def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -773,7 +778,7 @@ async def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[AsyncIterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_roles_operations.py index 009e8edf14ec..70ea79e75f05 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._cloud_service_roles_operations import build_get_request, build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -136,7 +141,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_operations.py index 5628224dd037..ddc2a3d3b216 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,6 +47,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -249,7 +254,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -310,7 +315,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -465,7 +470,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -577,7 +582,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -639,7 +644,7 @@ async def get(self, resource_group_name: str, cloud_service_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -699,7 +704,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -748,7 +753,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -832,7 +837,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -914,7 +919,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -969,7 +974,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1021,7 +1026,7 @@ async def _power_off_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1077,7 +1082,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1133,7 +1138,7 @@ async def _restart_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1281,7 +1286,7 @@ async def begin_restart( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -1340,7 +1345,7 @@ async def _reimage_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1491,7 +1496,7 @@ async def begin_reimage( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -1550,7 +1555,7 @@ async def _rebuild_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1704,7 +1709,7 @@ async def begin_rebuild( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -1763,7 +1768,7 @@ async def _delete_instances_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1911,7 +1916,7 @@ async def begin_delete_instances( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_update_domain_operations.py index e562759fafa1..5a7fb8cba2bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -36,6 +37,10 @@ build_walk_update_domain_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _walk_update_domain_initial( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -242,7 +247,7 @@ async def begin_walk_update_domain( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -316,7 +321,7 @@ async def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -370,7 +375,7 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/models/_models_py3.py index 61adbb389825..a3d49e565ac8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/models/_models_py3.py @@ -12,13 +12,14 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_operating_systems_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_operating_systems_operations.py index 8ade216daf6d..a03274775ea9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_operating_systems_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_operating_systems_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_get_os_version_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_os_versions_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +104,7 @@ def build_get_os_family_request(location: str, os_family_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +133,7 @@ def build_list_os_families_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -196,7 +201,7 @@ def get_os_version(self, location: str, os_version_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersion] request = build_get_os_version_request( @@ -246,7 +251,7 @@ def list_os_versions(self, location: str, **kwargs: Any) -> Iterable["_models.OS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersionListResult] error_map = { @@ -339,7 +344,7 @@ def get_os_family(self, location: str, os_family_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamily] request = build_get_os_family_request( @@ -389,7 +394,7 @@ def list_os_families(self, location: str, **kwargs: Any) -> Iterable["_models.OS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamilyListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_role_instances_operations.py index 9d0a53cf6611..8a4673bef414 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +87,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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +121,7 @@ def build_get_instance_view_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +158,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_restart_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_reimage_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +255,7 @@ def build_rebuild_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +287,7 @@ def build_get_remote_desktop_file_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/x-rdp") # Construct URL @@ -341,7 +346,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -399,7 +404,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -474,7 +479,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -538,7 +543,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -600,7 +605,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -684,7 +689,7 @@ def _restart_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -743,7 +748,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -796,7 +801,7 @@ def _reimage_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -855,7 +860,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -908,7 +913,7 @@ def _rebuild_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -968,7 +973,7 @@ def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[Iterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_roles_operations.py index 1b316fcd7da8..1a95c91227e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +79,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -200,7 +205,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_operations.py index 84db599a6ff6..280ba2eea125 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def build_get_instance_view_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +208,7 @@ def build_list_all_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -227,7 +232,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +262,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def build_power_off_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +324,7 @@ def build_restart_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -353,7 +358,7 @@ def build_reimage_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -387,7 +392,7 @@ def build_rebuild_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -421,7 +426,7 @@ def build_delete_instances_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -486,7 +491,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -648,7 +653,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -709,7 +714,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -864,7 +869,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -921,7 +926,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -974,7 +979,7 @@ def begin_delete(self, resource_group_name: str, cloud_service_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ def get(self, resource_group_name: str, cloud_service_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -1096,7 +1101,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -1144,7 +1149,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1227,7 +1232,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Clo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1309,7 +1314,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1362,7 +1367,7 @@ def begin_start(self, resource_group_name: str, cloud_service_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1414,7 +1419,7 @@ def _power_off_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1468,7 +1473,7 @@ def begin_power_off(self, resource_group_name: str, cloud_service_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1524,7 +1529,7 @@ def _restart_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1672,7 +1677,7 @@ def begin_restart( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -1731,7 +1736,7 @@ def _reimage_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1882,7 +1887,7 @@ def begin_reimage( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -1941,7 +1946,7 @@ def _rebuild_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2095,7 +2100,7 @@ def begin_rebuild( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -2154,7 +2159,7 @@ def _delete_instances_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2302,7 +2307,7 @@ def begin_delete_instances( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_update_domain_operations.py index e30bf8dad6b8..cf623194547f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_walk_update_domain_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_get_update_domain_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_list_update_domains_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def _walk_update_domain_initial( # pylint: disable=inconsistent-return-statemen _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -338,7 +343,7 @@ def begin_walk_update_domain( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -412,7 +417,7 @@ def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -465,7 +470,7 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/__init__.py deleted file mode 100644 index 835f3211b3cd..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._compute_management_client import ComputeManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = ["ComputeManagementClient"] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_compute_management_client.py deleted file mode 100644 index f17d8f793eab..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_compute_management_client.py +++ /dev/null @@ -1,119 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models -from .._serialization import Deserializer, Serializer -from ._configuration import ComputeManagementClientConfiguration -from .operations import ( - DiskAccessesOperations, - DiskEncryptionSetsOperations, - DiskRestorePointOperations, - DisksOperations, - SnapshotsOperations, -) - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class ComputeManagementClient: # pylint: disable=client-accepts-api-version-keyword - """Compute Client. - - :ivar disks: DisksOperations operations - :vartype disks: azure.mgmt.compute.v2022_07_02.operations.DisksOperations - :ivar disk_accesses: DiskAccessesOperations operations - :vartype disk_accesses: azure.mgmt.compute.v2022_07_02.operations.DiskAccessesOperations - :ivar disk_encryption_sets: DiskEncryptionSetsOperations operations - :vartype disk_encryption_sets: - azure.mgmt.compute.v2022_07_02.operations.DiskEncryptionSetsOperations - :ivar disk_restore_point: DiskRestorePointOperations operations - :vartype disk_restore_point: - azure.mgmt.compute.v2022_07_02.operations.DiskRestorePointOperations - :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2022_07_02.operations.SnapshotsOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-07-02". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = ComputeManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - 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)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.disks = DisksOperations(self._client, self._config, self._serialize, self._deserialize) - self.disk_accesses = DiskAccessesOperations(self._client, self._config, self._serialize, self._deserialize) - self.disk_encryption_sets = DiskEncryptionSetsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.disk_restore_point = DiskRestorePointOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> ComputeManagementClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_configuration.py deleted file mode 100644 index 082bd39d5c3c..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_configuration.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class ComputeManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for ComputeManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-07-02". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-07-02") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-compute/{}".format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> 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) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_metadata.json deleted file mode 100644 index e0fd1031417e..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_metadata.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "chosen_version": "2022-07-02", - "total_api_version_list": ["2022-07-02"], - "client": { - "name": "ComputeManagementClient", - "filename": "_compute_management_client", - "description": "Compute Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ComputeManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ComputeManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "disks": "DisksOperations", - "disk_accesses": "DiskAccessesOperations", - "disk_encryption_sets": "DiskEncryptionSetsOperations", - "disk_restore_point": "DiskRestorePointOperations", - "snapshots": "SnapshotsOperations" - } -} \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_patch.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_vendor.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_vendor.py deleted file mode 100644 index 9aad73fc743e..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py deleted file mode 100644 index a1b6f8ec6763..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "29.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/__init__.py deleted file mode 100644 index 2351b55ffa1d..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._compute_management_client import ComputeManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = ["ComputeManagementClient"] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_compute_management_client.py deleted file mode 100644 index 94f132ae1feb..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_compute_management_client.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models -from ..._serialization import Deserializer, Serializer -from ._configuration import ComputeManagementClientConfiguration -from .operations import ( - DiskAccessesOperations, - DiskEncryptionSetsOperations, - DiskRestorePointOperations, - DisksOperations, - SnapshotsOperations, -) - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class ComputeManagementClient: # pylint: disable=client-accepts-api-version-keyword - """Compute Client. - - :ivar disks: DisksOperations operations - :vartype disks: azure.mgmt.compute.v2022_07_02.aio.operations.DisksOperations - :ivar disk_accesses: DiskAccessesOperations operations - :vartype disk_accesses: azure.mgmt.compute.v2022_07_02.aio.operations.DiskAccessesOperations - :ivar disk_encryption_sets: DiskEncryptionSetsOperations operations - :vartype disk_encryption_sets: - azure.mgmt.compute.v2022_07_02.aio.operations.DiskEncryptionSetsOperations - :ivar disk_restore_point: DiskRestorePointOperations operations - :vartype disk_restore_point: - azure.mgmt.compute.v2022_07_02.aio.operations.DiskRestorePointOperations - :ivar snapshots: SnapshotsOperations operations - :vartype snapshots: azure.mgmt.compute.v2022_07_02.aio.operations.SnapshotsOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-07-02". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = ComputeManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - 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)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.disks = DisksOperations(self._client, self._config, self._serialize, self._deserialize) - self.disk_accesses = DiskAccessesOperations(self._client, self._config, self._serialize, self._deserialize) - self.disk_encryption_sets = DiskEncryptionSetsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.disk_restore_point = DiskRestorePointOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "ComputeManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_configuration.py deleted file mode 100644 index 37e73c404b6a..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_configuration.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class ComputeManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for ComputeManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-07-02". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-07-02") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-compute/{}".format(VERSION)) - self._configure(**kwargs) - - 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) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_patch.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/__init__.py deleted file mode 100644 index b013687c8bd2..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._disks_operations import DisksOperations -from ._disk_accesses_operations import DiskAccessesOperations -from ._disk_encryption_sets_operations import DiskEncryptionSetsOperations -from ._disk_restore_point_operations import DiskRestorePointOperations -from ._snapshots_operations import SnapshotsOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DisksOperations", - "DiskAccessesOperations", - "DiskEncryptionSetsOperations", - "DiskRestorePointOperations", - "SnapshotsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_accesses_operations.py deleted file mode 100644 index 9b6a17b69382..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_accesses_operations.py +++ /dev/null @@ -1,1418 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._disk_accesses_operations import ( - build_create_or_update_request, - build_delete_a_private_endpoint_connection_request, - build_delete_request, - build_get_a_private_endpoint_connection_request, - build_get_private_link_resources_request, - build_get_request, - build_list_by_resource_group_request, - build_list_private_endpoint_connections_request, - build_list_request, - build_update_a_private_endpoint_connection_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DiskAccessesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_07_02.aio.ComputeManagementClient`'s - :attr:`disk_accesses` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_or_update_initial( - self, resource_group_name: str, disk_access_name: str, disk_access: Union[_models.DiskAccess, IO], **kwargs: Any - ) -> _models.DiskAccess: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk_access, (IO, bytes)): - _content = disk_access - else: - _json = self._serialize.body(disk_access, "DiskAccess") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DiskAccess", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("DiskAccess", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: _models.DiskAccess, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskAccess]: - """Creates or updates a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Put disk access operation. - Required. - :type disk_access: ~azure.mgmt.compute.v2022_07_02.models.DiskAccess - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskAccess or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskAccess]: - """Creates or updates a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Put disk access operation. - Required. - :type disk_access: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskAccess or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, resource_group_name: str, disk_access_name: str, disk_access: Union[_models.DiskAccess, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.DiskAccess]: - """Creates or updates a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Put disk access operation. - Is either a model type or a IO type. Required. - :type disk_access: ~azure.mgmt.compute.v2022_07_02.models.DiskAccess or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskAccess or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - disk_access=disk_access, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DiskAccess", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: Union[_models.DiskAccessUpdate, IO], - **kwargs: Any - ) -> _models.DiskAccess: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk_access, (IO, bytes)): - _content = disk_access - else: - _json = self._serialize.body(disk_access, "DiskAccessUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DiskAccess", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("DiskAccess", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: _models.DiskAccessUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskAccess]: - """Updates (patches) a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Patch disk access operation. - Required. - :type disk_access: ~azure.mgmt.compute.v2022_07_02.models.DiskAccessUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskAccess or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskAccess]: - """Updates (patches) a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Patch disk access operation. - Required. - :type disk_access: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskAccess or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: Union[_models.DiskAccessUpdate, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskAccess]: - """Updates (patches) a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Patch disk access operation. - Is either a model type or a IO type. Required. - :type disk_access: ~azure.mgmt.compute.v2022_07_02.models.DiskAccessUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskAccess or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - disk_access=disk_access, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DiskAccess", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - @distributed_trace_async - async def get(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> _models.DiskAccess: - """Gets information about a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DiskAccess or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.DiskAccess - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] - - request = build_get_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DiskAccess", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, disk_access_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, disk_access_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: - """Lists all the disk access resources under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DiskAccess or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DiskAccessList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses"} # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: - """Lists all the disk access resources under a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DiskAccess or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DiskAccessList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses"} # type: ignore - - @distributed_trace_async - async def get_private_link_resources( - self, resource_group_name: str, disk_access_name: str, **kwargs: Any - ) -> _models.PrivateLinkResourceListResult: - """Gets the private link resources possible under disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkResourceListResult or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.PrivateLinkResourceListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] - - request = build_get_private_link_resources_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_private_link_resources.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_private_link_resources.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources"} # type: ignore - - async def _update_a_private_endpoint_connection_initial( - self, - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: Union[_models.PrivateEndpointConnection, IO], - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(private_endpoint_connection, (IO, bytes)): - _content = private_endpoint_connection - else: - _json = self._serialize.body(private_endpoint_connection, "PrivateEndpointConnection") - - request = build_update_a_private_endpoint_connection_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_a_private_endpoint_connection_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_a_private_endpoint_connection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - @overload - async def begin_update_a_private_endpoint_connection( - self, - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection under disk access resource, this can't be used - to create a new private endpoint connection. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: private endpoint connection object supplied in the body of - the Put private endpoint connection operation. Required. - :type private_endpoint_connection: - ~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_a_private_endpoint_connection( - self, - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection under disk access resource, this can't be used - to create a new private endpoint connection. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: private endpoint connection object supplied in the body of - the Put private endpoint connection operation. Required. - :type private_endpoint_connection: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_a_private_endpoint_connection( - self, - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: Union[_models.PrivateEndpointConnection, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection under disk access resource, this can't be used - to create a new private endpoint connection. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: private endpoint connection object supplied in the body of - the Put private endpoint connection operation. Is either a model type or a IO type. Required. - :type private_endpoint_connection: - ~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - 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] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_a_private_endpoint_connection_initial( # type: ignore - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - private_endpoint_connection_name=private_endpoint_connection_name, - private_endpoint_connection=private_endpoint_connection, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update_a_private_endpoint_connection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - @distributed_trace_async - async def get_a_private_endpoint_connection( - self, resource_group_name: str, disk_access_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Gets information about a private endpoint connection under a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - - request = build_get_a_private_endpoint_connection_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_a_private_endpoint_connection.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_a_private_endpoint_connection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - async def _delete_a_private_endpoint_connection_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, disk_access_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_a_private_endpoint_connection_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_a_private_endpoint_connection_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_a_private_endpoint_connection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - @distributed_trace_async - async def begin_delete_a_private_endpoint_connection( - self, resource_group_name: str, disk_access_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a private endpoint connection under a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_a_private_endpoint_connection_initial( # type: ignore - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_a_private_endpoint_connection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - @distributed_trace - def list_private_endpoint_connections( - self, resource_group_name: str, disk_access_name: str, **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnection"]: - """List information about private endpoint connections under a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnection or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_private_endpoint_connections_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_private_endpoint_connections.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - 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) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_private_endpoint_connections.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_encryption_sets_operations.py deleted file mode 100644 index e8877828b96c..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_encryption_sets_operations.py +++ /dev/null @@ -1,945 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._disk_encryption_sets_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_associated_resources_request, - build_list_by_resource_group_request, - build_list_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DiskEncryptionSetsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_07_02.aio.ComputeManagementClient`'s - :attr:`disk_encryption_sets` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_or_update_initial( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: Union[_models.DiskEncryptionSet, IO], - **kwargs: Any - ) -> _models.DiskEncryptionSet: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk_encryption_set, (IO, bytes)): - _content = disk_encryption_set - else: - _json = self._serialize.body(disk_encryption_set, "DiskEncryptionSet") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: _models.DiskEncryptionSet, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskEncryptionSet]: - """Creates or updates a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Put disk - encryption set operation. Required. - :type disk_encryption_set: ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskEncryptionSet]: - """Creates or updates a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Put disk - encryption set operation. Required. - :type disk_encryption_set: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: Union[_models.DiskEncryptionSet, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskEncryptionSet]: - """Creates or updates a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Put disk - encryption set operation. Is either a model type or a IO type. Required. - :type disk_encryption_set: ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - disk_encryption_set=disk_encryption_set, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: Union[_models.DiskEncryptionSetUpdate, IO], - **kwargs: Any - ) -> _models.DiskEncryptionSet: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk_encryption_set, (IO, bytes)): - _content = disk_encryption_set - else: - _json = self._serialize.body(disk_encryption_set, "DiskEncryptionSetUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: _models.DiskEncryptionSetUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskEncryptionSet]: - """Updates (patches) a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Patch disk - encryption set operation. Required. - :type disk_encryption_set: ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSetUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskEncryptionSet]: - """Updates (patches) a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Patch disk - encryption set operation. Required. - :type disk_encryption_set: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: Union[_models.DiskEncryptionSetUpdate, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.DiskEncryptionSet]: - """Updates (patches) a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Patch disk - encryption set operation. Is either a model type or a IO type. Required. - :type disk_encryption_set: ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSetUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - disk_encryption_set=disk_encryption_set, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: Any - ) -> _models.DiskEncryptionSet: - """Gets information about a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DiskEncryptionSet or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] - - request = build_get_request( - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DiskEncryptionSet"]: - """Lists all the disk encryption sets under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DiskEncryptionSet or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DiskEncryptionSetList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets"} # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: - """Lists all the disk encryption sets under a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DiskEncryptionSet or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DiskEncryptionSetList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets"} # type: ignore - - @distributed_trace - def list_associated_resources( - self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: Any - ) -> AsyncIterable[str]: - """Lists all resources that are encrypted with this disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either str or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_associated_resources_request( - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_associated_resources.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ResourceUriList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_associated_resources.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_restore_point_operations.py deleted file mode 100644 index 5d8e68b20f10..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_restore_point_operations.py +++ /dev/null @@ -1,605 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._disk_restore_point_operations import ( - build_get_request, - build_grant_access_request, - build_list_by_restore_point_request, - build_revoke_access_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DiskRestorePointOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_07_02.aio.ComputeManagementClient`'s - :attr:`disk_restore_point` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - **kwargs: Any - ) -> _models.DiskRestorePoint: - """Get disk restorePoint resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :param disk_restore_point_name: The name of the disk restore point created. Required. - :type disk_restore_point_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DiskRestorePoint or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.DiskRestorePoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] - - request = build_get_request( - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - disk_restore_point_name=disk_restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DiskRestorePoint", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}"} # type: ignore - - @distributed_trace - def list_by_restore_point( - self, resource_group_name: str, restore_point_collection_name: str, vm_restore_point_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DiskRestorePoint"]: - """Lists diskRestorePoints under a vmRestorePoint. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DiskRestorePoint or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_07_02.models.DiskRestorePoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_restore_point_request( - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_restore_point.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DiskRestorePointList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_restore_point.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints"} # type: ignore - - async def _grant_access_initial( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> Optional[_models.AccessUri]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(grant_access_data, (IO, bytes)): - _content = grant_access_data - else: - _json = self._serialize.body(grant_access_data, "GrantAccessData") - - request = build_grant_access_request( - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - disk_restore_point_name=disk_restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._grant_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AccessUri", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _grant_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess"} # type: ignore - - @overload - async def begin_grant_access( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - grant_access_data: _models.GrantAccessData, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a diskRestorePoint. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :param disk_restore_point_name: The name of the disk restore point created. Required. - :type disk_restore_point_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_grant_access( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - grant_access_data: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a diskRestorePoint. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :param disk_restore_point_name: The name of the disk restore point created. Required. - :type disk_restore_point_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Required. - :type grant_access_data: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_grant_access( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a diskRestorePoint. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :param disk_restore_point_name: The name of the disk restore point created. Required. - :type disk_restore_point_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Is either a model type or a IO type. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._grant_access_initial( # type: ignore - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - disk_restore_point_name=disk_restore_point_name, - grant_access_data=grant_access_data, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessUri", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_grant_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess"} # type: ignore - - async def _revoke_access_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_revoke_access_request( - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - disk_restore_point_name=disk_restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._revoke_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _revoke_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess"} # type: ignore - - @distributed_trace_async - async def begin_revoke_access( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Revokes access to a diskRestorePoint. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :param disk_restore_point_name: The name of the disk restore point created. Required. - :type disk_restore_point_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._revoke_access_initial( # type: ignore - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - disk_restore_point_name=disk_restore_point_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_revoke_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disks_operations.py deleted file mode 100644 index 686f37b01a78..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disks_operations.py +++ /dev/null @@ -1,1153 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._disks_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_grant_access_request, - build_list_by_resource_group_request, - build_list_request, - build_revoke_access_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DisksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_07_02.aio.ComputeManagementClient`'s - :attr:`disks` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_or_update_initial( - self, resource_group_name: str, disk_name: str, disk: Union[_models.Disk, IO], **kwargs: Any - ) -> _models.Disk: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk, (IO, bytes)): - _content = disk - else: - _json = self._serialize.body(disk, "Disk") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Disk", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Disk", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - disk_name: str, - disk: _models.Disk, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Disk]: - """Creates or updates a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Put disk operation. Required. - :type disk: ~azure.mgmt.compute.v2022_07_02.models.Disk - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - disk_name: str, - disk: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Disk]: - """Creates or updates a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Put disk operation. Required. - :type disk: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, resource_group_name: str, disk_name: str, disk: Union[_models.Disk, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.Disk]: - """Creates or updates a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Put disk operation. Is either a model type - or a IO type. Required. - :type disk: ~azure.mgmt.compute.v2022_07_02.models.Disk or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_name=disk_name, - disk=disk, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Disk", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - async def _update_initial( - self, resource_group_name: str, disk_name: str, disk: Union[_models.DiskUpdate, IO], **kwargs: Any - ) -> _models.Disk: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk, (IO, bytes)): - _content = disk - else: - _json = self._serialize.body(disk, "DiskUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Disk", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Disk", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - disk_name: str, - disk: _models.DiskUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Disk]: - """Updates (patches) a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Patch disk operation. Required. - :type disk: ~azure.mgmt.compute.v2022_07_02.models.DiskUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - disk_name: str, - disk: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Disk]: - """Updates (patches) a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Patch disk operation. Required. - :type disk: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, resource_group_name: str, disk_name: str, disk: Union[_models.DiskUpdate, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.Disk]: - """Updates (patches) a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Patch disk operation. Is either a model - type or a IO type. Required. - :type disk: ~azure.mgmt.compute.v2022_07_02.models.DiskUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_name=disk_name, - disk=disk, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Disk", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - @distributed_trace_async - async def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _models.Disk: - """Gets information about a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Disk or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.Disk - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] - - request = build_get_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Disk", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, disk_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - disk_name=disk_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Disk"]: - """Lists all the disks under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Disk or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DiskList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks"} # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: - """Lists all the disks under a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Disk or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DiskList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks"} # type: ignore - - async def _grant_access_initial( - self, - resource_group_name: str, - disk_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> Optional[_models.AccessUri]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(grant_access_data, (IO, bytes)): - _content = grant_access_data - else: - _json = self._serialize.body(grant_access_data, "GrantAccessData") - - request = build_grant_access_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._grant_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AccessUri", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _grant_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess"} # type: ignore - - @overload - async def begin_grant_access( - self, - resource_group_name: str, - disk_name: str, - grant_access_data: _models.GrantAccessData, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_grant_access( - self, - resource_group_name: str, - disk_name: str, - grant_access_data: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Required. - :type grant_access_data: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_grant_access( - self, - resource_group_name: str, - disk_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Is either a model type or a IO type. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._grant_access_initial( # type: ignore - resource_group_name=resource_group_name, - disk_name=disk_name, - grant_access_data=grant_access_data, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessUri", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_grant_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess"} # type: ignore - - async def _revoke_access_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, disk_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_revoke_access_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._revoke_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _revoke_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess"} # type: ignore - - @distributed_trace_async - async def begin_revoke_access( - self, resource_group_name: str, disk_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Revokes access to a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._revoke_access_initial( # type: ignore - resource_group_name=resource_group_name, - disk_name=disk_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_revoke_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_patch.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_snapshots_operations.py deleted file mode 100644 index 1d4fafd97b08..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_snapshots_operations.py +++ /dev/null @@ -1,1163 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._snapshots_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_grant_access_request, - build_list_by_resource_group_request, - build_list_request, - build_revoke_access_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SnapshotsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_07_02.aio.ComputeManagementClient`'s - :attr:`snapshots` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_or_update_initial( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.Snapshot, IO], **kwargs: Any - ) -> _models.Snapshot: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(snapshot, (IO, bytes)): - _content = snapshot - else: - _json = self._serialize.body(snapshot, "Snapshot") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: _models.Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Required. - :type snapshot: ~azure.mgmt.compute.v2022_07_02.models.Snapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Required. - :type snapshot: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.Snapshot, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Is either a - model type or a IO type. Required. - :type snapshot: ~azure.mgmt.compute.v2022_07_02.models.Snapshot or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - snapshot=snapshot, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Snapshot", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - async def _update_initial( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.SnapshotUpdate, IO], **kwargs: Any - ) -> _models.Snapshot: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(snapshot, (IO, bytes)): - _content = snapshot - else: - _json = self._serialize.body(snapshot, "SnapshotUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: _models.SnapshotUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. - Required. - :type snapshot: ~azure.mgmt.compute.v2022_07_02.models.SnapshotUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. - Required. - :type snapshot: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.SnapshotUpdate, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. Is - either a model type or a IO type. Required. - :type snapshot: ~azure.mgmt.compute.v2022_07_02.models.SnapshotUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Snapshot or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - snapshot=snapshot, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Snapshot", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - @distributed_trace_async - async def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _models.Snapshot: - """Gets information about a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - - request = build_get_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, snapshot_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: - """Lists snapshots under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots"} # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: - """Lists snapshots under a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots"} # type: ignore - - async def _grant_access_initial( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> Optional[_models.AccessUri]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(grant_access_data, (IO, bytes)): - _content = grant_access_data - else: - _json = self._serialize.body(grant_access_data, "GrantAccessData") - - request = build_grant_access_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._grant_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AccessUri", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _grant_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess"} # type: ignore - - @overload - async def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: _models.GrantAccessData, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Required. - :type grant_access_data: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Is either a model type or a IO type. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessUri or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._grant_access_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - grant_access_data=grant_access_data, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessUri", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_grant_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess"} # type: ignore - - async def _revoke_access_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, snapshot_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_revoke_access_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._revoke_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _revoke_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess"} # type: ignore - - @distributed_trace_async - async def begin_revoke_access( - self, resource_group_name: str, snapshot_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Revokes access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._revoke_access_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_revoke_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/__init__.py deleted file mode 100644 index a961d211432f..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/__init__.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._models_py3 import AccessUri -from ._models_py3 import ApiError -from ._models_py3 import ApiErrorBase -from ._models_py3 import CopyCompletionError -from ._models_py3 import CreationData -from ._models_py3 import Disk -from ._models_py3 import DiskAccess -from ._models_py3 import DiskAccessList -from ._models_py3 import DiskAccessUpdate -from ._models_py3 import DiskEncryptionSet -from ._models_py3 import DiskEncryptionSetList -from ._models_py3 import DiskEncryptionSetUpdate -from ._models_py3 import DiskList -from ._models_py3 import DiskRestorePoint -from ._models_py3 import DiskRestorePointList -from ._models_py3 import DiskSecurityProfile -from ._models_py3 import DiskSku -from ._models_py3 import DiskUpdate -from ._models_py3 import Encryption -from ._models_py3 import EncryptionSetIdentity -from ._models_py3 import EncryptionSettingsCollection -from ._models_py3 import EncryptionSettingsElement -from ._models_py3 import ExtendedLocation -from ._models_py3 import GrantAccessData -from ._models_py3 import ImageDiskReference -from ._models_py3 import InnerError -from ._models_py3 import KeyForDiskEncryptionSet -from ._models_py3 import KeyVaultAndKeyReference -from ._models_py3 import KeyVaultAndSecretReference -from ._models_py3 import PrivateEndpoint -from ._models_py3 import PrivateEndpointConnection -from ._models_py3 import PrivateEndpointConnectionListResult -from ._models_py3 import PrivateLinkResource -from ._models_py3 import PrivateLinkResourceListResult -from ._models_py3 import PrivateLinkServiceConnectionState -from ._models_py3 import PropertyUpdatesInProgress -from ._models_py3 import ProxyOnlyResource -from ._models_py3 import PurchasePlan -from ._models_py3 import Resource -from ._models_py3 import ResourceUriList -from ._models_py3 import ResourceWithOptionalLocation -from ._models_py3 import ShareInfoElement -from ._models_py3 import Snapshot -from ._models_py3 import SnapshotList -from ._models_py3 import SnapshotSku -from ._models_py3 import SnapshotUpdate -from ._models_py3 import SourceVault -from ._models_py3 import SubResource -from ._models_py3 import SubResourceReadOnly -from ._models_py3 import SupportedCapabilities -from ._models_py3 import UserAssignedIdentitiesValue - -from ._compute_management_client_enums import AccessLevel -from ._compute_management_client_enums import Architecture -from ._compute_management_client_enums import CopyCompletionErrorReason -from ._compute_management_client_enums import DataAccessAuthMode -from ._compute_management_client_enums import DiskCreateOption -from ._compute_management_client_enums import DiskEncryptionSetIdentityType -from ._compute_management_client_enums import DiskEncryptionSetType -from ._compute_management_client_enums import DiskSecurityTypes -from ._compute_management_client_enums import DiskState -from ._compute_management_client_enums import DiskStorageAccountTypes -from ._compute_management_client_enums import EncryptionType -from ._compute_management_client_enums import ExtendedLocationTypes -from ._compute_management_client_enums import HyperVGeneration -from ._compute_management_client_enums import NetworkAccessPolicy -from ._compute_management_client_enums import OperatingSystemTypes -from ._compute_management_client_enums import PrivateEndpointConnectionProvisioningState -from ._compute_management_client_enums import PrivateEndpointServiceConnectionStatus -from ._compute_management_client_enums import PublicNetworkAccess -from ._compute_management_client_enums import SnapshotStorageAccountTypes -from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccessUri", - "ApiError", - "ApiErrorBase", - "CopyCompletionError", - "CreationData", - "Disk", - "DiskAccess", - "DiskAccessList", - "DiskAccessUpdate", - "DiskEncryptionSet", - "DiskEncryptionSetList", - "DiskEncryptionSetUpdate", - "DiskList", - "DiskRestorePoint", - "DiskRestorePointList", - "DiskSecurityProfile", - "DiskSku", - "DiskUpdate", - "Encryption", - "EncryptionSetIdentity", - "EncryptionSettingsCollection", - "EncryptionSettingsElement", - "ExtendedLocation", - "GrantAccessData", - "ImageDiskReference", - "InnerError", - "KeyForDiskEncryptionSet", - "KeyVaultAndKeyReference", - "KeyVaultAndSecretReference", - "PrivateEndpoint", - "PrivateEndpointConnection", - "PrivateEndpointConnectionListResult", - "PrivateLinkResource", - "PrivateLinkResourceListResult", - "PrivateLinkServiceConnectionState", - "PropertyUpdatesInProgress", - "ProxyOnlyResource", - "PurchasePlan", - "Resource", - "ResourceUriList", - "ResourceWithOptionalLocation", - "ShareInfoElement", - "Snapshot", - "SnapshotList", - "SnapshotSku", - "SnapshotUpdate", - "SourceVault", - "SubResource", - "SubResourceReadOnly", - "SupportedCapabilities", - "UserAssignedIdentitiesValue", - "AccessLevel", - "Architecture", - "CopyCompletionErrorReason", - "DataAccessAuthMode", - "DiskCreateOption", - "DiskEncryptionSetIdentityType", - "DiskEncryptionSetType", - "DiskSecurityTypes", - "DiskState", - "DiskStorageAccountTypes", - "EncryptionType", - "ExtendedLocationTypes", - "HyperVGeneration", - "NetworkAccessPolicy", - "OperatingSystemTypes", - "PrivateEndpointConnectionProvisioningState", - "PrivateEndpointServiceConnectionStatus", - "PublicNetworkAccess", - "SnapshotStorageAccountTypes", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_compute_management_client_enums.py deleted file mode 100644 index d7aa998d84b8..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_compute_management_client_enums.py +++ /dev/null @@ -1,254 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessLevel.""" - - NONE = "None" - READ = "Read" - WRITE = "Write" - - -class Architecture(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CPU architecture supported by an OS disk.""" - - X64 = "x64" - ARM64 = "Arm64" - - -class CopyCompletionErrorReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the error code if the background copy of a resource created via the CopyStart - operation fails. - """ - - #: Indicates that the source snapshot was deleted while the background copy of the resource - #: created via CopyStart operation was in progress. - COPY_SOURCE_NOT_FOUND = "CopySourceNotFound" - - -class DataAccessAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Additional authentication requirements when exporting or uploading to a disk or snapshot.""" - - #: When export/upload URL is used, the system checks if the user has an identity in Azure Active - #: Directory and has necessary permissions to export/upload the data. Please refer to - #: aka.ms/DisksAzureADAuth. - AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" - #: No additional authentication would be performed when accessing export/upload URL. - NONE = "None" - - -class DiskCreateOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This enumerates the possible sources of a disk's creation.""" - - #: Create an empty data disk of a size given by diskSizeGB. - EMPTY = "Empty" - #: Disk will be attached to a VM. - ATTACH = "Attach" - #: Create a new disk from a platform image specified by the given imageReference or - #: galleryImageReference. - FROM_IMAGE = "FromImage" - #: Create a disk by importing from a blob specified by a sourceUri in a storage account specified - #: by storageAccountId. - IMPORT = "Import" - #: Create a new disk or snapshot by copying from a disk or snapshot specified by the given - #: sourceResourceId. - COPY = "Copy" - #: Create a new disk by copying from a backup recovery point. - RESTORE = "Restore" - #: Create a new disk by obtaining a write token and using it to directly upload the contents of - #: the disk. - UPLOAD = "Upload" - #: Create a new disk by using a deep copy process, where the resource creation is considered - #: complete only after all data has been copied from the source. - COPY_START = "CopyStart" - #: Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported - #: disk by importing additional blob for VM guest state specified by securityDataUri in storage - #: account specified by storageAccountId - IMPORT_SECURE = "ImportSecure" - #: Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported - #: disk and upload using write token in both disk and VM guest state - UPLOAD_PREPARED_SECURE = "UploadPreparedSecure" - - -class DiskEncryptionSetIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported - for new creations. Disk Encryption Sets can be updated with Identity type None during migration - of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources - to lose access to the keys. - """ - - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" - NONE = "None" - - -class DiskEncryptionSetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of key used to encrypt the data of the disk.""" - - #: Resource using diskEncryptionSet would be encrypted at rest with Customer managed key that can - #: be changed and revoked by a customer. - ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = "EncryptionAtRestWithCustomerKey" - #: Resource using diskEncryptionSet would be encrypted at rest with two layers of encryption. One - #: of the keys is Customer managed and the other key is Platform managed. - ENCRYPTION_AT_REST_WITH_PLATFORM_AND_CUSTOMER_KEYS = "EncryptionAtRestWithPlatformAndCustomerKeys" - #: Confidential VM supported disk and VM guest state would be encrypted with customer managed key. - CONFIDENTIAL_VM_ENCRYPTED_WITH_CUSTOMER_KEY = "ConfidentialVmEncryptedWithCustomerKey" - - -class DiskSecurityTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies the SecurityType of the VM. Applicable for OS disks only.""" - - #: Trusted Launch provides security features such as secure boot and virtual Trusted Platform - #: Module (vTPM) - TRUSTED_LAUNCH = "TrustedLaunch" - #: Indicates Confidential VM disk with only VM guest state encrypted - CONFIDENTIAL_VM_VMGUEST_STATE_ONLY_ENCRYPTED_WITH_PLATFORM_KEY = ( - "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" - ) - #: Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a platform - #: managed key - CONFIDENTIAL_VM_DISK_ENCRYPTED_WITH_PLATFORM_KEY = "ConfidentialVM_DiskEncryptedWithPlatformKey" - #: Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a customer - #: managed key - CONFIDENTIAL_VM_DISK_ENCRYPTED_WITH_CUSTOMER_KEY = "ConfidentialVM_DiskEncryptedWithCustomerKey" - - -class DiskState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This enumerates the possible state of the disk.""" - - #: The disk is not being used and can be attached to a VM. - UNATTACHED = "Unattached" - #: The disk is currently attached to a running VM. - ATTACHED = "Attached" - #: The disk is attached to a stopped-deallocated VM. - RESERVED = "Reserved" - #: The disk is attached to a VM which is in hibernated state. - FROZEN = "Frozen" - #: The disk currently has an Active SAS Uri associated with it. - ACTIVE_SAS = "ActiveSAS" - #: The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. - ACTIVE_SAS_FROZEN = "ActiveSASFrozen" - #: A disk is ready to be created by upload by requesting a write token. - READY_TO_UPLOAD = "ReadyToUpload" - #: A disk is created for upload and a write token has been issued for uploading to it. - ACTIVE_UPLOAD = "ActiveUpload" - - -class DiskStorageAccountTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The sku name.""" - - #: Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. - STANDARD_LRS = "Standard_LRS" - #: Premium SSD locally redundant storage. Best for production and performance sensitive workloads. - PREMIUM_LRS = "Premium_LRS" - #: Standard SSD locally redundant storage. Best for web servers, lightly used enterprise - #: applications and dev/test. - STANDARD_SSD_LRS = "StandardSSD_LRS" - #: Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top tier - #: databases (for example, SQL, Oracle), and other transaction-heavy workloads. - ULTRA_SSD_LRS = "UltraSSD_LRS" - #: Premium SSD zone redundant storage. Best for the production workloads that need storage - #: resiliency against zone failures. - PREMIUM_ZRS = "Premium_ZRS" - #: Standard SSD zone redundant storage. Best for web servers, lightly used enterprise applications - #: and dev/test that need storage resiliency against zone failures. - STANDARD_SSD_ZRS = "StandardSSD_ZRS" - #: Premium SSD v2 locally redundant storage. Best for production and performance-sensitive - #: workloads that consistently require low latency and high IOPS and throughput. - PREMIUM_V2_LRS = "PremiumV2_LRS" - - -class EncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of key used to encrypt the data of the disk.""" - - #: Disk is encrypted at rest with Platform managed key. It is the default encryption type. This is - #: not a valid encryption type for disk encryption sets. - ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = "EncryptionAtRestWithPlatformKey" - #: Disk is encrypted at rest with Customer managed key that can be changed and revoked by a - #: customer. - ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = "EncryptionAtRestWithCustomerKey" - #: Disk is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and - #: the other key is Platform managed. - ENCRYPTION_AT_REST_WITH_PLATFORM_AND_CUSTOMER_KEYS = "EncryptionAtRestWithPlatformAndCustomerKeys" - - -class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of extendedLocation.""" - - EDGE_ZONE = "EdgeZone" - - -class HyperVGeneration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The hypervisor generation of the Virtual Machine. Applicable to OS disks only.""" - - V1 = "V1" - V2 = "V2" - - -class NetworkAccessPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Policy for accessing the disk via network.""" - - #: The disk can be exported or uploaded to from any network. - ALLOW_ALL = "AllowAll" - #: The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. - ALLOW_PRIVATE = "AllowPrivate" - #: The disk cannot be exported. - DENY_ALL = "DenyAll" - - -class OperatingSystemTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Operating System type.""" - - WINDOWS = "Windows" - LINUX = "Linux" - - -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state.""" - - SUCCEEDED = "Succeeded" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - - -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status.""" - - PENDING = "Pending" - APPROVED = "Approved" - REJECTED = "Rejected" - - -class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Policy for controlling export on the disk.""" - - #: You can generate a SAS URI to access the underlying data of the disk publicly on the internet - #: when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from - #: your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. - ENABLED = "Enabled" - #: You cannot access the underlying data of the disk publicly on the internet even when - #: NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your - #: trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. - DISABLED = "Disabled" - - -class SnapshotStorageAccountTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The sku name.""" - - #: Standard HDD locally redundant storage - STANDARD_LRS = "Standard_LRS" - #: Premium SSD locally redundant storage - PREMIUM_LRS = "Premium_LRS" - #: Standard zone redundant storage - STANDARD_ZRS = "Standard_ZRS" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_models_py3.py deleted file mode 100644 index f423c09c8cb4..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_models_py3.py +++ /dev/null @@ -1,3117 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Dict, List, Optional, TYPE_CHECKING, Union - -from ... import _serialization - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models - - -class AccessUri(_serialization.Model): - """A disk access SAS uri. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_sas: A SAS uri for accessing a disk. - :vartype access_sas: str - :ivar security_data_access_sas: A SAS uri for accessing a VM guest state. - :vartype security_data_access_sas: str - """ - - _validation = { - "access_sas": {"readonly": True}, - "security_data_access_sas": {"readonly": True}, - } - - _attribute_map = { - "access_sas": {"key": "accessSAS", "type": "str"}, - "security_data_access_sas": {"key": "securityDataAccessSAS", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.access_sas = None - self.security_data_access_sas = None - - -class ApiError(_serialization.Model): - """Api error. - - :ivar details: The Api error details. - :vartype details: list[~azure.mgmt.compute.v2022_07_02.models.ApiErrorBase] - :ivar innererror: The Api inner error. - :vartype innererror: ~azure.mgmt.compute.v2022_07_02.models.InnerError - :ivar code: The error code. - :vartype code: str - :ivar target: The target of the particular error. - :vartype target: str - :ivar message: The error message. - :vartype message: str - """ - - _attribute_map = { - "details": {"key": "details", "type": "[ApiErrorBase]"}, - "innererror": {"key": "innererror", "type": "InnerError"}, - "code": {"key": "code", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__( - self, - *, - details: Optional[List["_models.ApiErrorBase"]] = None, - innererror: Optional["_models.InnerError"] = None, - code: Optional[str] = None, - target: Optional[str] = None, - message: Optional[str] = None, - **kwargs - ): - """ - :keyword details: The Api error details. - :paramtype details: list[~azure.mgmt.compute.v2022_07_02.models.ApiErrorBase] - :keyword innererror: The Api inner error. - :paramtype innererror: ~azure.mgmt.compute.v2022_07_02.models.InnerError - :keyword code: The error code. - :paramtype code: str - :keyword target: The target of the particular error. - :paramtype target: str - :keyword message: The error message. - :paramtype message: str - """ - super().__init__(**kwargs) - self.details = details - self.innererror = innererror - self.code = code - self.target = target - self.message = message - - -class ApiErrorBase(_serialization.Model): - """Api error base. - - :ivar code: The error code. - :vartype code: str - :ivar target: The target of the particular error. - :vartype target: str - :ivar message: The error message. - :vartype message: str - """ - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__( - self, *, code: Optional[str] = None, target: Optional[str] = None, message: Optional[str] = None, **kwargs - ): - """ - :keyword code: The error code. - :paramtype code: str - :keyword target: The target of the particular error. - :paramtype target: str - :keyword message: The error message. - :paramtype message: str - """ - super().__init__(**kwargs) - self.code = code - self.target = target - self.message = message - - -class CopyCompletionError(_serialization.Model): - """Indicates the error details if the background copy of a resource created via the CopyStart operation fails. - - All required parameters must be populated in order to send to Azure. - - :ivar error_code: Indicates the error code if the background copy of a resource created via the - CopyStart operation fails. Required. "CopySourceNotFound" - :vartype error_code: str or ~azure.mgmt.compute.v2022_07_02.models.CopyCompletionErrorReason - :ivar error_message: Indicates the error message if the background copy of a resource created - via the CopyStart operation fails. Required. - :vartype error_message: str - """ - - _validation = { - "error_code": {"required": True}, - "error_message": {"required": True}, - } - - _attribute_map = { - "error_code": {"key": "errorCode", "type": "str"}, - "error_message": {"key": "errorMessage", "type": "str"}, - } - - def __init__(self, *, error_code: Union[str, "_models.CopyCompletionErrorReason"], error_message: str, **kwargs): - """ - :keyword error_code: Indicates the error code if the background copy of a resource created via - the CopyStart operation fails. Required. "CopySourceNotFound" - :paramtype error_code: str or ~azure.mgmt.compute.v2022_07_02.models.CopyCompletionErrorReason - :keyword error_message: Indicates the error message if the background copy of a resource - created via the CopyStart operation fails. Required. - :paramtype error_message: str - """ - super().__init__(**kwargs) - self.error_code = error_code - self.error_message = error_message - - -class CreationData(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Data used when creating a disk. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar create_option: This enumerates the possible sources of a disk's creation. Required. Known - values are: "Empty", "Attach", "FromImage", "Import", "Copy", "Restore", "Upload", "CopyStart", - "ImportSecure", and "UploadPreparedSecure". - :vartype create_option: str or ~azure.mgmt.compute.v2022_07_02.models.DiskCreateOption - :ivar storage_account_id: Required if createOption is Import. The Azure Resource Manager - identifier of the storage account containing the blob to import as a disk. - :vartype storage_account_id: str - :ivar image_reference: Disk source information for PIR or user images. - :vartype image_reference: ~azure.mgmt.compute.v2022_07_02.models.ImageDiskReference - :ivar gallery_image_reference: Required if creating from a Gallery Image. The - id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference will be the ARM id of - the shared galley image version from which to create a disk. - :vartype gallery_image_reference: ~azure.mgmt.compute.v2022_07_02.models.ImageDiskReference - :ivar source_uri: If createOption is Import, this is the URI of a blob to be imported into a - managed disk. - :vartype source_uri: str - :ivar source_resource_id: If createOption is Copy, this is the ARM id of the source snapshot or - disk. - :vartype source_resource_id: str - :ivar source_unique_id: If this field is set, this is the unique id identifying the source of - this resource. - :vartype source_unique_id: str - :ivar upload_size_bytes: If createOption is Upload, this is the size of the contents of the - upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for - the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). - :vartype upload_size_bytes: int - :ivar logical_sector_size: Logical sector size in bytes for Ultra disks. Supported values are - 512 ad 4096. 4096 is the default. - :vartype logical_sector_size: int - :ivar security_data_uri: If createOption is ImportSecure, this is the URI of a blob to be - imported into VM guest state. - :vartype security_data_uri: str - :ivar performance_plus: Set this flag to true to get a boost on the performance target of the - disk deployed, see here on the respective performance target. This flag can only be set on disk - creation time and cannot be disabled after enabled. - :vartype performance_plus: bool - """ - - _validation = { - "create_option": {"required": True}, - "source_unique_id": {"readonly": True}, - } - - _attribute_map = { - "create_option": {"key": "createOption", "type": "str"}, - "storage_account_id": {"key": "storageAccountId", "type": "str"}, - "image_reference": {"key": "imageReference", "type": "ImageDiskReference"}, - "gallery_image_reference": {"key": "galleryImageReference", "type": "ImageDiskReference"}, - "source_uri": {"key": "sourceUri", "type": "str"}, - "source_resource_id": {"key": "sourceResourceId", "type": "str"}, - "source_unique_id": {"key": "sourceUniqueId", "type": "str"}, - "upload_size_bytes": {"key": "uploadSizeBytes", "type": "int"}, - "logical_sector_size": {"key": "logicalSectorSize", "type": "int"}, - "security_data_uri": {"key": "securityDataUri", "type": "str"}, - "performance_plus": {"key": "performancePlus", "type": "bool"}, - } - - def __init__( - self, - *, - create_option: Union[str, "_models.DiskCreateOption"], - storage_account_id: Optional[str] = None, - image_reference: Optional["_models.ImageDiskReference"] = None, - gallery_image_reference: Optional["_models.ImageDiskReference"] = None, - source_uri: Optional[str] = None, - source_resource_id: Optional[str] = None, - upload_size_bytes: Optional[int] = None, - logical_sector_size: Optional[int] = None, - security_data_uri: Optional[str] = None, - performance_plus: Optional[bool] = None, - **kwargs - ): - """ - :keyword create_option: This enumerates the possible sources of a disk's creation. Required. - Known values are: "Empty", "Attach", "FromImage", "Import", "Copy", "Restore", "Upload", - "CopyStart", "ImportSecure", and "UploadPreparedSecure". - :paramtype create_option: str or ~azure.mgmt.compute.v2022_07_02.models.DiskCreateOption - :keyword storage_account_id: Required if createOption is Import. The Azure Resource Manager - identifier of the storage account containing the blob to import as a disk. - :paramtype storage_account_id: str - :keyword image_reference: Disk source information for PIR or user images. - :paramtype image_reference: ~azure.mgmt.compute.v2022_07_02.models.ImageDiskReference - :keyword gallery_image_reference: Required if creating from a Gallery Image. The - id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference will be the ARM id of - the shared galley image version from which to create a disk. - :paramtype gallery_image_reference: ~azure.mgmt.compute.v2022_07_02.models.ImageDiskReference - :keyword source_uri: If createOption is Import, this is the URI of a blob to be imported into a - managed disk. - :paramtype source_uri: str - :keyword source_resource_id: If createOption is Copy, this is the ARM id of the source snapshot - or disk. - :paramtype source_resource_id: str - :keyword upload_size_bytes: If createOption is Upload, this is the size of the contents of the - upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for - the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). - :paramtype upload_size_bytes: int - :keyword logical_sector_size: Logical sector size in bytes for Ultra disks. Supported values - are 512 ad 4096. 4096 is the default. - :paramtype logical_sector_size: int - :keyword security_data_uri: If createOption is ImportSecure, this is the URI of a blob to be - imported into VM guest state. - :paramtype security_data_uri: str - :keyword performance_plus: Set this flag to true to get a boost on the performance target of - the disk deployed, see here on the respective performance target. This flag can only be set on - disk creation time and cannot be disabled after enabled. - :paramtype performance_plus: bool - """ - super().__init__(**kwargs) - self.create_option = create_option - self.storage_account_id = storage_account_id - self.image_reference = image_reference - self.gallery_image_reference = gallery_image_reference - self.source_uri = source_uri - self.source_resource_id = source_resource_id - self.source_unique_id = None - self.upload_size_bytes = upload_size_bytes - self.logical_sector_size = logical_sector_size - self.security_data_uri = security_data_uri - self.performance_plus = performance_plus - - -class Resource(_serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - - -class Disk(Resource): # pylint: disable=too-many-instance-attributes - """Disk resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar managed_by: A relative URI containing the ID of the VM that has the disk attached. - :vartype managed_by: str - :ivar managed_by_extended: List of relative URIs containing the IDs of the VMs that have the - disk attached. maxShares should be set to a value greater than one for disks to allow attaching - them to multiple VMs. - :vartype managed_by_extended: list[str] - :ivar sku: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, - Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. - :vartype sku: ~azure.mgmt.compute.v2022_07_02.models.DiskSku - :ivar zones: The Logical zone list for Disk. - :vartype zones: list[str] - :ivar extended_location: The extended location where the disk will be created. Extended - location cannot be changed. - :vartype extended_location: ~azure.mgmt.compute.v2022_07_02.models.ExtendedLocation - :ivar time_created: The time when the disk was created. - :vartype time_created: ~datetime.datetime - :ivar os_type: The Operating System type. Known values are: "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2022_07_02.models.OperatingSystemTypes - :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :vartype hyper_v_generation: str or ~azure.mgmt.compute.v2022_07_02.models.HyperVGeneration - :ivar purchase_plan: Purchase plan information for the the image from which the OS disk was - created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: - WindowsServer}. - :vartype purchase_plan: ~azure.mgmt.compute.v2022_07_02.models.PurchasePlan - :ivar supported_capabilities: List of supported capabilities for the image from which the OS - disk was created. - :vartype supported_capabilities: ~azure.mgmt.compute.v2022_07_02.models.SupportedCapabilities - :ivar creation_data: Disk source information. CreationData information cannot be changed after - the disk has been created. - :vartype creation_data: ~azure.mgmt.compute.v2022_07_02.models.CreationData - :ivar disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :vartype disk_size_gb: int - :ivar disk_size_bytes: The size of the disk in bytes. This field is read only. - :vartype disk_size_bytes: int - :ivar unique_id: Unique Guid identifying the resource. - :vartype unique_id: str - :ivar encryption_settings_collection: Encryption settings collection used for Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :vartype encryption_settings_collection: - ~azure.mgmt.compute.v2022_07_02.models.EncryptionSettingsCollection - :ivar provisioning_state: The disk provisioning state. - :vartype provisioning_state: str - :ivar disk_iops_read_write: The number of IOPS allowed for this disk; only settable for - UltraSSD disks. One operation can transfer between 4k and 256k bytes. - :vartype disk_iops_read_write: int - :ivar disk_m_bps_read_write: The bandwidth allowed for this disk; only settable for UltraSSD - disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of - 10. - :vartype disk_m_bps_read_write: int - :ivar disk_iops_read_only: The total number of IOPS that will be allowed across all VMs - mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. - :vartype disk_iops_read_only: int - :ivar disk_m_bps_read_only: The total throughput (MBps) that will be allowed across all VMs - mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses - the ISO notation, of powers of 10. - :vartype disk_m_bps_read_only: int - :ivar disk_state: The state of the disk. Known values are: "Unattached", "Attached", - "Reserved", "Frozen", "ActiveSAS", "ActiveSASFrozen", "ReadyToUpload", and "ActiveUpload". - :vartype disk_state: str or ~azure.mgmt.compute.v2022_07_02.models.DiskState - :ivar encryption: Encryption property can be used to encrypt data at rest with customer managed - keys or platform managed keys. - :vartype encryption: ~azure.mgmt.compute.v2022_07_02.models.Encryption - :ivar max_shares: The maximum number of VMs that can attach to the disk at the same time. Value - greater than one indicates a disk that can be mounted on multiple VMs at the same time. - :vartype max_shares: int - :ivar share_info: Details of the list of all VMs that have the disk attached. maxShares should - be set to a value greater than one for disks to allow attaching them to multiple VMs. - :vartype share_info: list[~azure.mgmt.compute.v2022_07_02.models.ShareInfoElement] - :ivar network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :vartype network_access_policy: str or - ~azure.mgmt.compute.v2022_07_02.models.NetworkAccessPolicy - :ivar disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. - :vartype disk_access_id: str - :ivar bursting_enabled_time: Latest time when bursting was last enabled on a disk. - :vartype bursting_enabled_time: ~datetime.datetime - :ivar tier: Performance tier of the disk (e.g, P4, S10) as described here: - https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra - disks. - :vartype tier: str - :ivar bursting_enabled: Set to true to enable bursting beyond the provisioned performance - target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. - :vartype bursting_enabled: bool - :ivar property_updates_in_progress: Properties of the disk for which update is pending. - :vartype property_updates_in_progress: - ~azure.mgmt.compute.v2022_07_02.models.PropertyUpdatesInProgress - :ivar supports_hibernation: Indicates the OS on a disk supports hibernation. - :vartype supports_hibernation: bool - :ivar security_profile: Contains the security related information for the resource. - :vartype security_profile: ~azure.mgmt.compute.v2022_07_02.models.DiskSecurityProfile - :ivar completion_percent: Percentage complete for the background copy when a resource is - created via the CopyStart operation. - :vartype completion_percent: float - :ivar public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.compute.v2022_07_02.models.PublicNetworkAccess - :ivar data_access_auth_mode: Additional authentication requirements when exporting or uploading - to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :vartype data_access_auth_mode: str or - ~azure.mgmt.compute.v2022_07_02.models.DataAccessAuthMode - :ivar optimized_for_frequent_attach: Setting this property to true improves reliability and - performance of data disks that are frequently (more than 5 times a day) by detached from one - virtual machine and attached to another. This property should not be set for disks that are not - detached and attached frequently as it causes the disks to not align with the fault domain of - the virtual machine. - :vartype optimized_for_frequent_attach: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "managed_by": {"readonly": True}, - "managed_by_extended": {"readonly": True}, - "time_created": {"readonly": True}, - "disk_size_bytes": {"readonly": True}, - "unique_id": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "disk_state": {"readonly": True}, - "share_info": {"readonly": True}, - "bursting_enabled_time": {"readonly": True}, - "property_updates_in_progress": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "managed_by": {"key": "managedBy", "type": "str"}, - "managed_by_extended": {"key": "managedByExtended", "type": "[str]"}, - "sku": {"key": "sku", "type": "DiskSku"}, - "zones": {"key": "zones", "type": "[str]"}, - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, - "time_created": {"key": "properties.timeCreated", "type": "iso-8601"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, - "purchase_plan": {"key": "properties.purchasePlan", "type": "PurchasePlan"}, - "supported_capabilities": {"key": "properties.supportedCapabilities", "type": "SupportedCapabilities"}, - "creation_data": {"key": "properties.creationData", "type": "CreationData"}, - "disk_size_gb": {"key": "properties.diskSizeGB", "type": "int"}, - "disk_size_bytes": {"key": "properties.diskSizeBytes", "type": "int"}, - "unique_id": {"key": "properties.uniqueId", "type": "str"}, - "encryption_settings_collection": { - "key": "properties.encryptionSettingsCollection", - "type": "EncryptionSettingsCollection", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "disk_iops_read_write": {"key": "properties.diskIOPSReadWrite", "type": "int"}, - "disk_m_bps_read_write": {"key": "properties.diskMBpsReadWrite", "type": "int"}, - "disk_iops_read_only": {"key": "properties.diskIOPSReadOnly", "type": "int"}, - "disk_m_bps_read_only": {"key": "properties.diskMBpsReadOnly", "type": "int"}, - "disk_state": {"key": "properties.diskState", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "Encryption"}, - "max_shares": {"key": "properties.maxShares", "type": "int"}, - "share_info": {"key": "properties.shareInfo", "type": "[ShareInfoElement]"}, - "network_access_policy": {"key": "properties.networkAccessPolicy", "type": "str"}, - "disk_access_id": {"key": "properties.diskAccessId", "type": "str"}, - "bursting_enabled_time": {"key": "properties.burstingEnabledTime", "type": "iso-8601"}, - "tier": {"key": "properties.tier", "type": "str"}, - "bursting_enabled": {"key": "properties.burstingEnabled", "type": "bool"}, - "property_updates_in_progress": { - "key": "properties.propertyUpdatesInProgress", - "type": "PropertyUpdatesInProgress", - }, - "supports_hibernation": {"key": "properties.supportsHibernation", "type": "bool"}, - "security_profile": {"key": "properties.securityProfile", "type": "DiskSecurityProfile"}, - "completion_percent": {"key": "properties.completionPercent", "type": "float"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "data_access_auth_mode": {"key": "properties.dataAccessAuthMode", "type": "str"}, - "optimized_for_frequent_attach": {"key": "properties.optimizedForFrequentAttach", "type": "bool"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - sku: Optional["_models.DiskSku"] = None, - zones: Optional[List[str]] = None, - extended_location: Optional["_models.ExtendedLocation"] = None, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, - purchase_plan: Optional["_models.PurchasePlan"] = None, - supported_capabilities: Optional["_models.SupportedCapabilities"] = None, - creation_data: Optional["_models.CreationData"] = None, - disk_size_gb: Optional[int] = None, - encryption_settings_collection: Optional["_models.EncryptionSettingsCollection"] = None, - disk_iops_read_write: Optional[int] = None, - disk_m_bps_read_write: Optional[int] = None, - disk_iops_read_only: Optional[int] = None, - disk_m_bps_read_only: Optional[int] = None, - encryption: Optional["_models.Encryption"] = None, - max_shares: Optional[int] = None, - network_access_policy: Optional[Union[str, "_models.NetworkAccessPolicy"]] = None, - disk_access_id: Optional[str] = None, - tier: Optional[str] = None, - bursting_enabled: Optional[bool] = None, - supports_hibernation: Optional[bool] = None, - security_profile: Optional["_models.DiskSecurityProfile"] = None, - completion_percent: Optional[float] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - data_access_auth_mode: Optional[Union[str, "_models.DataAccessAuthMode"]] = None, - optimized_for_frequent_attach: Optional[bool] = None, - **kwargs - ): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, - UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. - :paramtype sku: ~azure.mgmt.compute.v2022_07_02.models.DiskSku - :keyword zones: The Logical zone list for Disk. - :paramtype zones: list[str] - :keyword extended_location: The extended location where the disk will be created. Extended - location cannot be changed. - :paramtype extended_location: ~azure.mgmt.compute.v2022_07_02.models.ExtendedLocation - :keyword os_type: The Operating System type. Known values are: "Windows" and "Linux". - :paramtype os_type: str or ~azure.mgmt.compute.v2022_07_02.models.OperatingSystemTypes - :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :paramtype hyper_v_generation: str or ~azure.mgmt.compute.v2022_07_02.models.HyperVGeneration - :keyword purchase_plan: Purchase plan information for the the image from which the OS disk was - created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: - WindowsServer}. - :paramtype purchase_plan: ~azure.mgmt.compute.v2022_07_02.models.PurchasePlan - :keyword supported_capabilities: List of supported capabilities for the image from which the OS - disk was created. - :paramtype supported_capabilities: ~azure.mgmt.compute.v2022_07_02.models.SupportedCapabilities - :keyword creation_data: Disk source information. CreationData information cannot be changed - after the disk has been created. - :paramtype creation_data: ~azure.mgmt.compute.v2022_07_02.models.CreationData - :keyword disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :paramtype disk_size_gb: int - :keyword encryption_settings_collection: Encryption settings collection used for Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :paramtype encryption_settings_collection: - ~azure.mgmt.compute.v2022_07_02.models.EncryptionSettingsCollection - :keyword disk_iops_read_write: The number of IOPS allowed for this disk; only settable for - UltraSSD disks. One operation can transfer between 4k and 256k bytes. - :paramtype disk_iops_read_write: int - :keyword disk_m_bps_read_write: The bandwidth allowed for this disk; only settable for UltraSSD - disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of - 10. - :paramtype disk_m_bps_read_write: int - :keyword disk_iops_read_only: The total number of IOPS that will be allowed across all VMs - mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. - :paramtype disk_iops_read_only: int - :keyword disk_m_bps_read_only: The total throughput (MBps) that will be allowed across all VMs - mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses - the ISO notation, of powers of 10. - :paramtype disk_m_bps_read_only: int - :keyword encryption: Encryption property can be used to encrypt data at rest with customer - managed keys or platform managed keys. - :paramtype encryption: ~azure.mgmt.compute.v2022_07_02.models.Encryption - :keyword max_shares: The maximum number of VMs that can attach to the disk at the same time. - Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. - :paramtype max_shares: int - :keyword network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :paramtype network_access_policy: str or - ~azure.mgmt.compute.v2022_07_02.models.NetworkAccessPolicy - :keyword disk_access_id: ARM id of the DiskAccess resource for using private endpoints on - disks. - :paramtype disk_access_id: str - :keyword tier: Performance tier of the disk (e.g, P4, S10) as described here: - https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra - disks. - :paramtype tier: str - :keyword bursting_enabled: Set to true to enable bursting beyond the provisioned performance - target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. - :paramtype bursting_enabled: bool - :keyword supports_hibernation: Indicates the OS on a disk supports hibernation. - :paramtype supports_hibernation: bool - :keyword security_profile: Contains the security related information for the resource. - :paramtype security_profile: ~azure.mgmt.compute.v2022_07_02.models.DiskSecurityProfile - :keyword completion_percent: Percentage complete for the background copy when a resource is - created via the CopyStart operation. - :paramtype completion_percent: float - :keyword public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.compute.v2022_07_02.models.PublicNetworkAccess - :keyword data_access_auth_mode: Additional authentication requirements when exporting or - uploading to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :paramtype data_access_auth_mode: str or - ~azure.mgmt.compute.v2022_07_02.models.DataAccessAuthMode - :keyword optimized_for_frequent_attach: Setting this property to true improves reliability and - performance of data disks that are frequently (more than 5 times a day) by detached from one - virtual machine and attached to another. This property should not be set for disks that are not - detached and attached frequently as it causes the disks to not align with the fault domain of - the virtual machine. - :paramtype optimized_for_frequent_attach: bool - """ - super().__init__(location=location, tags=tags, **kwargs) - self.managed_by = None - self.managed_by_extended = None - self.sku = sku - self.zones = zones - self.extended_location = extended_location - self.time_created = None - self.os_type = os_type - self.hyper_v_generation = hyper_v_generation - self.purchase_plan = purchase_plan - self.supported_capabilities = supported_capabilities - self.creation_data = creation_data - self.disk_size_gb = disk_size_gb - self.disk_size_bytes = None - self.unique_id = None - self.encryption_settings_collection = encryption_settings_collection - self.provisioning_state = None - self.disk_iops_read_write = disk_iops_read_write - self.disk_m_bps_read_write = disk_m_bps_read_write - self.disk_iops_read_only = disk_iops_read_only - self.disk_m_bps_read_only = disk_m_bps_read_only - self.disk_state = None - self.encryption = encryption - self.max_shares = max_shares - self.share_info = None - self.network_access_policy = network_access_policy - self.disk_access_id = disk_access_id - self.bursting_enabled_time = None - self.tier = tier - self.bursting_enabled = bursting_enabled - self.property_updates_in_progress = None - self.supports_hibernation = supports_hibernation - self.security_profile = security_profile - self.completion_percent = completion_percent - self.public_network_access = public_network_access - self.data_access_auth_mode = data_access_auth_mode - self.optimized_for_frequent_attach = optimized_for_frequent_attach - - -class DiskAccess(Resource): - """disk access resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar extended_location: The extended location where the disk access will be created. Extended - location cannot be changed. - :vartype extended_location: ~azure.mgmt.compute.v2022_07_02.models.ExtendedLocation - :ivar private_endpoint_connections: A readonly collection of private endpoint connections - created on the disk. Currently only one endpoint connection is supported. - :vartype private_endpoint_connections: - list[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :ivar provisioning_state: The disk access resource provisioning state. - :vartype provisioning_state: str - :ivar time_created: The time when the disk access was created. - :vartype time_created: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "private_endpoint_connections": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "time_created": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[PrivateEndpointConnection]", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "time_created": {"key": "properties.timeCreated", "type": "iso-8601"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - extended_location: Optional["_models.ExtendedLocation"] = None, - **kwargs - ): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword extended_location: The extended location where the disk access will be created. - Extended location cannot be changed. - :paramtype extended_location: ~azure.mgmt.compute.v2022_07_02.models.ExtendedLocation - """ - super().__init__(location=location, tags=tags, **kwargs) - self.extended_location = extended_location - self.private_endpoint_connections = None - self.provisioning_state = None - self.time_created = None - - -class DiskAccessList(_serialization.Model): - """The List disk access operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of disk access resources. Required. - :vartype value: list[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :ivar next_link: The uri to fetch the next page of disk access resources. Call ListNext() with - this to fetch the next page of disk access resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DiskAccess]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DiskAccess"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of disk access resources. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :keyword next_link: The uri to fetch the next page of disk access resources. Call ListNext() - with this to fetch the next page of disk access resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class DiskAccessUpdate(_serialization.Model): - """Used for updating a disk access resource. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - -class DiskEncryptionSet(Resource): # pylint: disable=too-many-instance-attributes - """disk encryption set resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: The managed identity for the disk encryption set. It should be given permission - on the key vault before it can be used to encrypt disks. - :vartype identity: ~azure.mgmt.compute.v2022_07_02.models.EncryptionSetIdentity - :ivar encryption_type: The type of key used to encrypt the data of the disk. Known values are: - "EncryptionAtRestWithCustomerKey", "EncryptionAtRestWithPlatformAndCustomerKeys", and - "ConfidentialVmEncryptedWithCustomerKey". - :vartype encryption_type: str or ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSetType - :ivar active_key: The key vault key which is currently used by this disk encryption set. - :vartype active_key: ~azure.mgmt.compute.v2022_07_02.models.KeyForDiskEncryptionSet - :ivar previous_keys: A readonly collection of key vault keys previously used by this disk - encryption set while a key rotation is in progress. It will be empty if there is no ongoing key - rotation. - :vartype previous_keys: list[~azure.mgmt.compute.v2022_07_02.models.KeyForDiskEncryptionSet] - :ivar provisioning_state: The disk encryption set provisioning state. - :vartype provisioning_state: str - :ivar rotation_to_latest_key_version_enabled: Set this flag to true to enable auto-updating of - this disk encryption set to the latest key version. - :vartype rotation_to_latest_key_version_enabled: bool - :ivar last_key_rotation_timestamp: The time when the active key of this disk encryption set was - updated. - :vartype last_key_rotation_timestamp: ~datetime.datetime - :ivar auto_key_rotation_error: The error that was encountered during auto-key rotation. If an - error is present, then auto-key rotation will not be attempted until the error on this disk - encryption set is fixed. - :vartype auto_key_rotation_error: ~azure.mgmt.compute.v2022_07_02.models.ApiError - :ivar federated_client_id: Multi-tenant application client id to access key vault in a - different tenant. Setting the value to 'None' will clear the property. - :vartype federated_client_id: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "previous_keys": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "last_key_rotation_timestamp": {"readonly": True}, - "auto_key_rotation_error": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "EncryptionSetIdentity"}, - "encryption_type": {"key": "properties.encryptionType", "type": "str"}, - "active_key": {"key": "properties.activeKey", "type": "KeyForDiskEncryptionSet"}, - "previous_keys": {"key": "properties.previousKeys", "type": "[KeyForDiskEncryptionSet]"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "rotation_to_latest_key_version_enabled": { - "key": "properties.rotationToLatestKeyVersionEnabled", - "type": "bool", - }, - "last_key_rotation_timestamp": {"key": "properties.lastKeyRotationTimestamp", "type": "iso-8601"}, - "auto_key_rotation_error": {"key": "properties.autoKeyRotationError", "type": "ApiError"}, - "federated_client_id": {"key": "properties.federatedClientId", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.EncryptionSetIdentity"] = None, - encryption_type: Optional[Union[str, "_models.DiskEncryptionSetType"]] = None, - active_key: Optional["_models.KeyForDiskEncryptionSet"] = None, - rotation_to_latest_key_version_enabled: Optional[bool] = None, - federated_client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: The managed identity for the disk encryption set. It should be given - permission on the key vault before it can be used to encrypt disks. - :paramtype identity: ~azure.mgmt.compute.v2022_07_02.models.EncryptionSetIdentity - :keyword encryption_type: The type of key used to encrypt the data of the disk. Known values - are: "EncryptionAtRestWithCustomerKey", "EncryptionAtRestWithPlatformAndCustomerKeys", and - "ConfidentialVmEncryptedWithCustomerKey". - :paramtype encryption_type: str or ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSetType - :keyword active_key: The key vault key which is currently used by this disk encryption set. - :paramtype active_key: ~azure.mgmt.compute.v2022_07_02.models.KeyForDiskEncryptionSet - :keyword rotation_to_latest_key_version_enabled: Set this flag to true to enable auto-updating - of this disk encryption set to the latest key version. - :paramtype rotation_to_latest_key_version_enabled: bool - :keyword federated_client_id: Multi-tenant application client id to access key vault in a - different tenant. Setting the value to 'None' will clear the property. - :paramtype federated_client_id: str - """ - super().__init__(location=location, tags=tags, **kwargs) - self.identity = identity - self.encryption_type = encryption_type - self.active_key = active_key - self.previous_keys = None - self.provisioning_state = None - self.rotation_to_latest_key_version_enabled = rotation_to_latest_key_version_enabled - self.last_key_rotation_timestamp = None - self.auto_key_rotation_error = None - self.federated_client_id = federated_client_id - - -class DiskEncryptionSetList(_serialization.Model): - """The List disk encryption set operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of disk encryption sets. Required. - :vartype value: list[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :ivar next_link: The uri to fetch the next page of disk encryption sets. Call ListNext() with - this to fetch the next page of disk encryption sets. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DiskEncryptionSet]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DiskEncryptionSet"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of disk encryption sets. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :keyword next_link: The uri to fetch the next page of disk encryption sets. Call ListNext() - with this to fetch the next page of disk encryption sets. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class DiskEncryptionSetUpdate(_serialization.Model): - """disk encryption set update resource. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: The managed identity for the disk encryption set. It should be given permission - on the key vault before it can be used to encrypt disks. - :vartype identity: ~azure.mgmt.compute.v2022_07_02.models.EncryptionSetIdentity - :ivar encryption_type: The type of key used to encrypt the data of the disk. Known values are: - "EncryptionAtRestWithCustomerKey", "EncryptionAtRestWithPlatformAndCustomerKeys", and - "ConfidentialVmEncryptedWithCustomerKey". - :vartype encryption_type: str or ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSetType - :ivar active_key: Key Vault Key Url to be used for server side encryption of Managed Disks and - Snapshots. - :vartype active_key: ~azure.mgmt.compute.v2022_07_02.models.KeyForDiskEncryptionSet - :ivar rotation_to_latest_key_version_enabled: Set this flag to true to enable auto-updating of - this disk encryption set to the latest key version. - :vartype rotation_to_latest_key_version_enabled: bool - :ivar federated_client_id: Multi-tenant application client id to access key vault in a - different tenant. Setting the value to 'None' will clear the property. - :vartype federated_client_id: str - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "EncryptionSetIdentity"}, - "encryption_type": {"key": "properties.encryptionType", "type": "str"}, - "active_key": {"key": "properties.activeKey", "type": "KeyForDiskEncryptionSet"}, - "rotation_to_latest_key_version_enabled": { - "key": "properties.rotationToLatestKeyVersionEnabled", - "type": "bool", - }, - "federated_client_id": {"key": "properties.federatedClientId", "type": "str"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.EncryptionSetIdentity"] = None, - encryption_type: Optional[Union[str, "_models.DiskEncryptionSetType"]] = None, - active_key: Optional["_models.KeyForDiskEncryptionSet"] = None, - rotation_to_latest_key_version_enabled: Optional[bool] = None, - federated_client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: The managed identity for the disk encryption set. It should be given - permission on the key vault before it can be used to encrypt disks. - :paramtype identity: ~azure.mgmt.compute.v2022_07_02.models.EncryptionSetIdentity - :keyword encryption_type: The type of key used to encrypt the data of the disk. Known values - are: "EncryptionAtRestWithCustomerKey", "EncryptionAtRestWithPlatformAndCustomerKeys", and - "ConfidentialVmEncryptedWithCustomerKey". - :paramtype encryption_type: str or ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSetType - :keyword active_key: Key Vault Key Url to be used for server side encryption of Managed Disks - and Snapshots. - :paramtype active_key: ~azure.mgmt.compute.v2022_07_02.models.KeyForDiskEncryptionSet - :keyword rotation_to_latest_key_version_enabled: Set this flag to true to enable auto-updating - of this disk encryption set to the latest key version. - :paramtype rotation_to_latest_key_version_enabled: bool - :keyword federated_client_id: Multi-tenant application client id to access key vault in a - different tenant. Setting the value to 'None' will clear the property. - :paramtype federated_client_id: str - """ - super().__init__(**kwargs) - self.tags = tags - self.identity = identity - self.encryption_type = encryption_type - self.active_key = active_key - self.rotation_to_latest_key_version_enabled = rotation_to_latest_key_version_enabled - self.federated_client_id = federated_client_id - - -class DiskList(_serialization.Model): - """The List Disks operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of disks. Required. - :vartype value: list[~azure.mgmt.compute.v2022_07_02.models.Disk] - :ivar next_link: The uri to fetch the next page of disks. Call ListNext() with this to fetch - the next page of disks. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Disk]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Disk"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of disks. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_07_02.models.Disk] - :keyword next_link: The uri to fetch the next page of disks. Call ListNext() with this to fetch - the next page of disks. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ProxyOnlyResource(_serialization.Model): - """The ProxyOnly Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class DiskRestorePoint(ProxyOnlyResource): # pylint: disable=too-many-instance-attributes - """Properties of disk restore point. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar time_created: The timestamp of restorePoint creation. - :vartype time_created: ~datetime.datetime - :ivar source_resource_id: arm id of source disk or source disk restore point. - :vartype source_resource_id: str - :ivar os_type: The Operating System type. Known values are: "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2022_07_02.models.OperatingSystemTypes - :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :vartype hyper_v_generation: str or ~azure.mgmt.compute.v2022_07_02.models.HyperVGeneration - :ivar purchase_plan: Purchase plan information for the the image from which the OS disk was - created. - :vartype purchase_plan: ~azure.mgmt.compute.v2022_07_02.models.PurchasePlan - :ivar supported_capabilities: List of supported capabilities for the image from which the OS - disk was created. - :vartype supported_capabilities: ~azure.mgmt.compute.v2022_07_02.models.SupportedCapabilities - :ivar family_id: id of the backing snapshot's MIS family. - :vartype family_id: str - :ivar source_unique_id: unique incarnation id of the source disk. - :vartype source_unique_id: str - :ivar encryption: Encryption property can be used to encrypt data at rest with customer managed - keys or platform managed keys. - :vartype encryption: ~azure.mgmt.compute.v2022_07_02.models.Encryption - :ivar supports_hibernation: Indicates the OS on a disk supports hibernation. - :vartype supports_hibernation: bool - :ivar network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :vartype network_access_policy: str or - ~azure.mgmt.compute.v2022_07_02.models.NetworkAccessPolicy - :ivar public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.compute.v2022_07_02.models.PublicNetworkAccess - :ivar disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. - :vartype disk_access_id: str - :ivar completion_percent: Percentage complete for the background copy of disk restore point - when source resource is from a different region. - :vartype completion_percent: float - :ivar replication_state: Replication state of disk restore point when source resource is from a - different region. - :vartype replication_state: str - :ivar source_resource_location: Location of source disk or source disk restore point when - source resource is from a different region. - :vartype source_resource_location: str - :ivar security_profile: Contains the security related information for the resource. - :vartype security_profile: ~azure.mgmt.compute.v2022_07_02.models.DiskSecurityProfile - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "time_created": {"readonly": True}, - "source_resource_id": {"readonly": True}, - "os_type": {"readonly": True}, - "family_id": {"readonly": True}, - "source_unique_id": {"readonly": True}, - "encryption": {"readonly": True}, - "replication_state": {"readonly": True}, - "source_resource_location": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "time_created": {"key": "properties.timeCreated", "type": "iso-8601"}, - "source_resource_id": {"key": "properties.sourceResourceId", "type": "str"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, - "purchase_plan": {"key": "properties.purchasePlan", "type": "PurchasePlan"}, - "supported_capabilities": {"key": "properties.supportedCapabilities", "type": "SupportedCapabilities"}, - "family_id": {"key": "properties.familyId", "type": "str"}, - "source_unique_id": {"key": "properties.sourceUniqueId", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "Encryption"}, - "supports_hibernation": {"key": "properties.supportsHibernation", "type": "bool"}, - "network_access_policy": {"key": "properties.networkAccessPolicy", "type": "str"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "disk_access_id": {"key": "properties.diskAccessId", "type": "str"}, - "completion_percent": {"key": "properties.completionPercent", "type": "float"}, - "replication_state": {"key": "properties.replicationState", "type": "str"}, - "source_resource_location": {"key": "properties.sourceResourceLocation", "type": "str"}, - "security_profile": {"key": "properties.securityProfile", "type": "DiskSecurityProfile"}, - } - - def __init__( - self, - *, - hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, - purchase_plan: Optional["_models.PurchasePlan"] = None, - supported_capabilities: Optional["_models.SupportedCapabilities"] = None, - supports_hibernation: Optional[bool] = None, - network_access_policy: Optional[Union[str, "_models.NetworkAccessPolicy"]] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - disk_access_id: Optional[str] = None, - completion_percent: Optional[float] = None, - security_profile: Optional["_models.DiskSecurityProfile"] = None, - **kwargs - ): - """ - :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :paramtype hyper_v_generation: str or ~azure.mgmt.compute.v2022_07_02.models.HyperVGeneration - :keyword purchase_plan: Purchase plan information for the the image from which the OS disk was - created. - :paramtype purchase_plan: ~azure.mgmt.compute.v2022_07_02.models.PurchasePlan - :keyword supported_capabilities: List of supported capabilities for the image from which the OS - disk was created. - :paramtype supported_capabilities: ~azure.mgmt.compute.v2022_07_02.models.SupportedCapabilities - :keyword supports_hibernation: Indicates the OS on a disk supports hibernation. - :paramtype supports_hibernation: bool - :keyword network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :paramtype network_access_policy: str or - ~azure.mgmt.compute.v2022_07_02.models.NetworkAccessPolicy - :keyword public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.compute.v2022_07_02.models.PublicNetworkAccess - :keyword disk_access_id: ARM id of the DiskAccess resource for using private endpoints on - disks. - :paramtype disk_access_id: str - :keyword completion_percent: Percentage complete for the background copy of disk restore point - when source resource is from a different region. - :paramtype completion_percent: float - :keyword security_profile: Contains the security related information for the resource. - :paramtype security_profile: ~azure.mgmt.compute.v2022_07_02.models.DiskSecurityProfile - """ - super().__init__(**kwargs) - self.time_created = None - self.source_resource_id = None - self.os_type = None - self.hyper_v_generation = hyper_v_generation - self.purchase_plan = purchase_plan - self.supported_capabilities = supported_capabilities - self.family_id = None - self.source_unique_id = None - self.encryption = None - self.supports_hibernation = supports_hibernation - self.network_access_policy = network_access_policy - self.public_network_access = public_network_access - self.disk_access_id = disk_access_id - self.completion_percent = completion_percent - self.replication_state = None - self.source_resource_location = None - self.security_profile = security_profile - - -class DiskRestorePointList(_serialization.Model): - """The List Disk Restore Points operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of disk restore points. Required. - :vartype value: list[~azure.mgmt.compute.v2022_07_02.models.DiskRestorePoint] - :ivar next_link: The uri to fetch the next page of disk restore points. Call ListNext() with - this to fetch the next page of disk restore points. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DiskRestorePoint]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DiskRestorePoint"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of disk restore points. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_07_02.models.DiskRestorePoint] - :keyword next_link: The uri to fetch the next page of disk restore points. Call ListNext() with - this to fetch the next page of disk restore points. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class DiskSecurityProfile(_serialization.Model): - """Contains the security related information for the resource. - - :ivar security_type: Specifies the SecurityType of the VM. Applicable for OS disks only. Known - values are: "TrustedLaunch", "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", - "ConfidentialVM_DiskEncryptedWithPlatformKey", and - "ConfidentialVM_DiskEncryptedWithCustomerKey". - :vartype security_type: str or ~azure.mgmt.compute.v2022_07_02.models.DiskSecurityTypes - :ivar secure_vm_disk_encryption_set_id: ResourceId of the disk encryption set associated to - Confidential VM supported disk encrypted with customer managed key. - :vartype secure_vm_disk_encryption_set_id: str - """ - - _attribute_map = { - "security_type": {"key": "securityType", "type": "str"}, - "secure_vm_disk_encryption_set_id": {"key": "secureVMDiskEncryptionSetId", "type": "str"}, - } - - def __init__( - self, - *, - security_type: Optional[Union[str, "_models.DiskSecurityTypes"]] = None, - secure_vm_disk_encryption_set_id: Optional[str] = None, - **kwargs - ): - """ - :keyword security_type: Specifies the SecurityType of the VM. Applicable for OS disks only. - Known values are: "TrustedLaunch", "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", - "ConfidentialVM_DiskEncryptedWithPlatformKey", and - "ConfidentialVM_DiskEncryptedWithCustomerKey". - :paramtype security_type: str or ~azure.mgmt.compute.v2022_07_02.models.DiskSecurityTypes - :keyword secure_vm_disk_encryption_set_id: ResourceId of the disk encryption set associated to - Confidential VM supported disk encrypted with customer managed key. - :paramtype secure_vm_disk_encryption_set_id: str - """ - super().__init__(**kwargs) - self.security_type = security_type - self.secure_vm_disk_encryption_set_id = secure_vm_disk_encryption_set_id - - -class DiskSku(_serialization.Model): - """The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The sku name. Known values are: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS", - "UltraSSD_LRS", "Premium_ZRS", "StandardSSD_ZRS", and "PremiumV2_LRS". - :vartype name: str or ~azure.mgmt.compute.v2022_07_02.models.DiskStorageAccountTypes - :ivar tier: The sku tier. - :vartype tier: str - """ - - _validation = { - "tier": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - } - - def __init__(self, *, name: Optional[Union[str, "_models.DiskStorageAccountTypes"]] = None, **kwargs): - """ - :keyword name: The sku name. Known values are: "Standard_LRS", "Premium_LRS", - "StandardSSD_LRS", "UltraSSD_LRS", "Premium_ZRS", "StandardSSD_ZRS", and "PremiumV2_LRS". - :paramtype name: str or ~azure.mgmt.compute.v2022_07_02.models.DiskStorageAccountTypes - """ - super().__init__(**kwargs) - self.name = name - self.tier = None - - -class DiskUpdate(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Disk update resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, - Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. - :vartype sku: ~azure.mgmt.compute.v2022_07_02.models.DiskSku - :ivar os_type: the Operating System type. Known values are: "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2022_07_02.models.OperatingSystemTypes - :ivar disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :vartype disk_size_gb: int - :ivar encryption_settings_collection: Encryption settings collection used be Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :vartype encryption_settings_collection: - ~azure.mgmt.compute.v2022_07_02.models.EncryptionSettingsCollection - :ivar disk_iops_read_write: The number of IOPS allowed for this disk; only settable for - UltraSSD disks. One operation can transfer between 4k and 256k bytes. - :vartype disk_iops_read_write: int - :ivar disk_m_bps_read_write: The bandwidth allowed for this disk; only settable for UltraSSD - disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of - 10. - :vartype disk_m_bps_read_write: int - :ivar disk_iops_read_only: The total number of IOPS that will be allowed across all VMs - mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. - :vartype disk_iops_read_only: int - :ivar disk_m_bps_read_only: The total throughput (MBps) that will be allowed across all VMs - mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses - the ISO notation, of powers of 10. - :vartype disk_m_bps_read_only: int - :ivar max_shares: The maximum number of VMs that can attach to the disk at the same time. Value - greater than one indicates a disk that can be mounted on multiple VMs at the same time. - :vartype max_shares: int - :ivar encryption: Encryption property can be used to encrypt data at rest with customer managed - keys or platform managed keys. - :vartype encryption: ~azure.mgmt.compute.v2022_07_02.models.Encryption - :ivar network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :vartype network_access_policy: str or - ~azure.mgmt.compute.v2022_07_02.models.NetworkAccessPolicy - :ivar disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. - :vartype disk_access_id: str - :ivar tier: Performance tier of the disk (e.g, P4, S10) as described here: - https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra - disks. - :vartype tier: str - :ivar bursting_enabled: Set to true to enable bursting beyond the provisioned performance - target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. - :vartype bursting_enabled: bool - :ivar purchase_plan: Purchase plan information to be added on the OS disk. - :vartype purchase_plan: ~azure.mgmt.compute.v2022_07_02.models.PurchasePlan - :ivar supported_capabilities: List of supported capabilities to be added on the OS disk. - :vartype supported_capabilities: ~azure.mgmt.compute.v2022_07_02.models.SupportedCapabilities - :ivar property_updates_in_progress: Properties of the disk for which update is pending. - :vartype property_updates_in_progress: - ~azure.mgmt.compute.v2022_07_02.models.PropertyUpdatesInProgress - :ivar supports_hibernation: Indicates the OS on a disk supports hibernation. - :vartype supports_hibernation: bool - :ivar public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.compute.v2022_07_02.models.PublicNetworkAccess - :ivar data_access_auth_mode: Additional authentication requirements when exporting or uploading - to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :vartype data_access_auth_mode: str or - ~azure.mgmt.compute.v2022_07_02.models.DataAccessAuthMode - :ivar optimized_for_frequent_attach: Setting this property to true improves reliability and - performance of data disks that are frequently (more than 5 times a day) by detached from one - virtual machine and attached to another. This property should not be set for disks that are not - detached and attached frequently as it causes the disks to not align with the fault domain of - the virtual machine. - :vartype optimized_for_frequent_attach: bool - """ - - _validation = { - "property_updates_in_progress": {"readonly": True}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "DiskSku"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "disk_size_gb": {"key": "properties.diskSizeGB", "type": "int"}, - "encryption_settings_collection": { - "key": "properties.encryptionSettingsCollection", - "type": "EncryptionSettingsCollection", - }, - "disk_iops_read_write": {"key": "properties.diskIOPSReadWrite", "type": "int"}, - "disk_m_bps_read_write": {"key": "properties.diskMBpsReadWrite", "type": "int"}, - "disk_iops_read_only": {"key": "properties.diskIOPSReadOnly", "type": "int"}, - "disk_m_bps_read_only": {"key": "properties.diskMBpsReadOnly", "type": "int"}, - "max_shares": {"key": "properties.maxShares", "type": "int"}, - "encryption": {"key": "properties.encryption", "type": "Encryption"}, - "network_access_policy": {"key": "properties.networkAccessPolicy", "type": "str"}, - "disk_access_id": {"key": "properties.diskAccessId", "type": "str"}, - "tier": {"key": "properties.tier", "type": "str"}, - "bursting_enabled": {"key": "properties.burstingEnabled", "type": "bool"}, - "purchase_plan": {"key": "properties.purchasePlan", "type": "PurchasePlan"}, - "supported_capabilities": {"key": "properties.supportedCapabilities", "type": "SupportedCapabilities"}, - "property_updates_in_progress": { - "key": "properties.propertyUpdatesInProgress", - "type": "PropertyUpdatesInProgress", - }, - "supports_hibernation": {"key": "properties.supportsHibernation", "type": "bool"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "data_access_auth_mode": {"key": "properties.dataAccessAuthMode", "type": "str"}, - "optimized_for_frequent_attach": {"key": "properties.optimizedForFrequentAttach", "type": "bool"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["_models.DiskSku"] = None, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - disk_size_gb: Optional[int] = None, - encryption_settings_collection: Optional["_models.EncryptionSettingsCollection"] = None, - disk_iops_read_write: Optional[int] = None, - disk_m_bps_read_write: Optional[int] = None, - disk_iops_read_only: Optional[int] = None, - disk_m_bps_read_only: Optional[int] = None, - max_shares: Optional[int] = None, - encryption: Optional["_models.Encryption"] = None, - network_access_policy: Optional[Union[str, "_models.NetworkAccessPolicy"]] = None, - disk_access_id: Optional[str] = None, - tier: Optional[str] = None, - bursting_enabled: Optional[bool] = None, - purchase_plan: Optional["_models.PurchasePlan"] = None, - supported_capabilities: Optional["_models.SupportedCapabilities"] = None, - supports_hibernation: Optional[bool] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - data_access_auth_mode: Optional[Union[str, "_models.DataAccessAuthMode"]] = None, - optimized_for_frequent_attach: Optional[bool] = None, - **kwargs - ): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, - UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. - :paramtype sku: ~azure.mgmt.compute.v2022_07_02.models.DiskSku - :keyword os_type: the Operating System type. Known values are: "Windows" and "Linux". - :paramtype os_type: str or ~azure.mgmt.compute.v2022_07_02.models.OperatingSystemTypes - :keyword disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :paramtype disk_size_gb: int - :keyword encryption_settings_collection: Encryption settings collection used be Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :paramtype encryption_settings_collection: - ~azure.mgmt.compute.v2022_07_02.models.EncryptionSettingsCollection - :keyword disk_iops_read_write: The number of IOPS allowed for this disk; only settable for - UltraSSD disks. One operation can transfer between 4k and 256k bytes. - :paramtype disk_iops_read_write: int - :keyword disk_m_bps_read_write: The bandwidth allowed for this disk; only settable for UltraSSD - disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of - 10. - :paramtype disk_m_bps_read_write: int - :keyword disk_iops_read_only: The total number of IOPS that will be allowed across all VMs - mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. - :paramtype disk_iops_read_only: int - :keyword disk_m_bps_read_only: The total throughput (MBps) that will be allowed across all VMs - mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses - the ISO notation, of powers of 10. - :paramtype disk_m_bps_read_only: int - :keyword max_shares: The maximum number of VMs that can attach to the disk at the same time. - Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. - :paramtype max_shares: int - :keyword encryption: Encryption property can be used to encrypt data at rest with customer - managed keys or platform managed keys. - :paramtype encryption: ~azure.mgmt.compute.v2022_07_02.models.Encryption - :keyword network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :paramtype network_access_policy: str or - ~azure.mgmt.compute.v2022_07_02.models.NetworkAccessPolicy - :keyword disk_access_id: ARM id of the DiskAccess resource for using private endpoints on - disks. - :paramtype disk_access_id: str - :keyword tier: Performance tier of the disk (e.g, P4, S10) as described here: - https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra - disks. - :paramtype tier: str - :keyword bursting_enabled: Set to true to enable bursting beyond the provisioned performance - target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. - :paramtype bursting_enabled: bool - :keyword purchase_plan: Purchase plan information to be added on the OS disk. - :paramtype purchase_plan: ~azure.mgmt.compute.v2022_07_02.models.PurchasePlan - :keyword supported_capabilities: List of supported capabilities to be added on the OS disk. - :paramtype supported_capabilities: ~azure.mgmt.compute.v2022_07_02.models.SupportedCapabilities - :keyword supports_hibernation: Indicates the OS on a disk supports hibernation. - :paramtype supports_hibernation: bool - :keyword public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.compute.v2022_07_02.models.PublicNetworkAccess - :keyword data_access_auth_mode: Additional authentication requirements when exporting or - uploading to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :paramtype data_access_auth_mode: str or - ~azure.mgmt.compute.v2022_07_02.models.DataAccessAuthMode - :keyword optimized_for_frequent_attach: Setting this property to true improves reliability and - performance of data disks that are frequently (more than 5 times a day) by detached from one - virtual machine and attached to another. This property should not be set for disks that are not - detached and attached frequently as it causes the disks to not align with the fault domain of - the virtual machine. - :paramtype optimized_for_frequent_attach: bool - """ - super().__init__(**kwargs) - self.tags = tags - self.sku = sku - self.os_type = os_type - self.disk_size_gb = disk_size_gb - self.encryption_settings_collection = encryption_settings_collection - self.disk_iops_read_write = disk_iops_read_write - self.disk_m_bps_read_write = disk_m_bps_read_write - self.disk_iops_read_only = disk_iops_read_only - self.disk_m_bps_read_only = disk_m_bps_read_only - self.max_shares = max_shares - self.encryption = encryption - self.network_access_policy = network_access_policy - self.disk_access_id = disk_access_id - self.tier = tier - self.bursting_enabled = bursting_enabled - self.purchase_plan = purchase_plan - self.supported_capabilities = supported_capabilities - self.property_updates_in_progress = None - self.supports_hibernation = supports_hibernation - self.public_network_access = public_network_access - self.data_access_auth_mode = data_access_auth_mode - self.optimized_for_frequent_attach = optimized_for_frequent_attach - - -class Encryption(_serialization.Model): - """Encryption at rest settings for disk or snapshot. - - :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :vartype disk_encryption_set_id: str - :ivar type: The type of key used to encrypt the data of the disk. Known values are: - "EncryptionAtRestWithPlatformKey", "EncryptionAtRestWithCustomerKey", and - "EncryptionAtRestWithPlatformAndCustomerKeys". - :vartype type: str or ~azure.mgmt.compute.v2022_07_02.models.EncryptionType - """ - - _attribute_map = { - "disk_encryption_set_id": {"key": "diskEncryptionSetId", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__( - self, - *, - disk_encryption_set_id: Optional[str] = None, - type: Optional[Union[str, "_models.EncryptionType"]] = None, - **kwargs - ): - """ - :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :paramtype disk_encryption_set_id: str - :keyword type: The type of key used to encrypt the data of the disk. Known values are: - "EncryptionAtRestWithPlatformKey", "EncryptionAtRestWithCustomerKey", and - "EncryptionAtRestWithPlatformAndCustomerKeys". - :paramtype type: str or ~azure.mgmt.compute.v2022_07_02.models.EncryptionType - """ - super().__init__(**kwargs) - self.disk_encryption_set_id = disk_encryption_set_id - self.type = type - - -class EncryptionSetIdentity(_serialization.Model): - """The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is - supported for new creations. Disk Encryption Sets can be updated with Identity type None during - migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted - resources to lose access to the keys. Known values are: "SystemAssigned", "UserAssigned", - "SystemAssigned, UserAssigned", and "None". - :vartype type: str or ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSetIdentityType - :ivar principal_id: The object id of the Managed Identity Resource. This will be sent to the RP - from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a - systemAssigned(implicit) identity. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the Managed Identity Resource. This will be sent to the RP - from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a - systemAssigned(implicit) identity. - :vartype tenant_id: str - :ivar user_assigned_identities: The list of user identities associated with the disk encryption - set. The user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2022_07_02.models.UserAssignedIdentitiesValue] - """ - - _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "principal_id": {"key": "principalId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentitiesValue}"}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "_models.DiskEncryptionSetIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentitiesValue"]] = None, - **kwargs - ): - """ - :keyword type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned - is supported for new creations. Disk Encryption Sets can be updated with Identity type None - during migration of subscription to a new Azure Active Directory tenant; it will cause the - encrypted resources to lose access to the keys. Known values are: "SystemAssigned", - "UserAssigned", "SystemAssigned, UserAssigned", and "None". - :paramtype type: str or ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSetIdentityType - :keyword user_assigned_identities: The list of user identities associated with the disk - encryption set. The user identity dictionary key references will be ARM resource ids in the - form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2022_07_02.models.UserAssignedIdentitiesValue] - """ - super().__init__(**kwargs) - self.type = type - self.principal_id = None - self.tenant_id = None - self.user_assigned_identities = user_assigned_identities - - -class EncryptionSettingsCollection(_serialization.Model): - """Encryption settings for disk or snapshot. - - All required parameters must be populated in order to send to Azure. - - :ivar enabled: Set this flag to true and provide DiskEncryptionKey and optional - KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and - KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, - the existing settings remain unchanged. Required. - :vartype enabled: bool - :ivar encryption_settings: A collection of encryption settings, one for each disk volume. - :vartype encryption_settings: - list[~azure.mgmt.compute.v2022_07_02.models.EncryptionSettingsElement] - :ivar encryption_settings_version: Describes what type of encryption is used for the disks. - Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption - with AAD app.'1.1' corresponds to Azure Disk Encryption. - :vartype encryption_settings_version: str - """ - - _validation = { - "enabled": {"required": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "encryption_settings": {"key": "encryptionSettings", "type": "[EncryptionSettingsElement]"}, - "encryption_settings_version": {"key": "encryptionSettingsVersion", "type": "str"}, - } - - def __init__( - self, - *, - enabled: bool, - encryption_settings: Optional[List["_models.EncryptionSettingsElement"]] = None, - encryption_settings_version: Optional[str] = None, - **kwargs - ): - """ - :keyword enabled: Set this flag to true and provide DiskEncryptionKey and optional - KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and - KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, - the existing settings remain unchanged. Required. - :paramtype enabled: bool - :keyword encryption_settings: A collection of encryption settings, one for each disk volume. - :paramtype encryption_settings: - list[~azure.mgmt.compute.v2022_07_02.models.EncryptionSettingsElement] - :keyword encryption_settings_version: Describes what type of encryption is used for the disks. - Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption - with AAD app.'1.1' corresponds to Azure Disk Encryption. - :paramtype encryption_settings_version: str - """ - super().__init__(**kwargs) - self.enabled = enabled - self.encryption_settings = encryption_settings - self.encryption_settings_version = encryption_settings_version - - -class EncryptionSettingsElement(_serialization.Model): - """Encryption settings for one disk volume. - - :ivar disk_encryption_key: Key Vault Secret Url and vault id of the disk encryption key. - :vartype disk_encryption_key: ~azure.mgmt.compute.v2022_07_02.models.KeyVaultAndSecretReference - :ivar key_encryption_key: Key Vault Key Url and vault id of the key encryption key. - KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. - :vartype key_encryption_key: ~azure.mgmt.compute.v2022_07_02.models.KeyVaultAndKeyReference - """ - - _attribute_map = { - "disk_encryption_key": {"key": "diskEncryptionKey", "type": "KeyVaultAndSecretReference"}, - "key_encryption_key": {"key": "keyEncryptionKey", "type": "KeyVaultAndKeyReference"}, - } - - def __init__( - self, - *, - disk_encryption_key: Optional["_models.KeyVaultAndSecretReference"] = None, - key_encryption_key: Optional["_models.KeyVaultAndKeyReference"] = None, - **kwargs - ): - """ - :keyword disk_encryption_key: Key Vault Secret Url and vault id of the disk encryption key. - :paramtype disk_encryption_key: - ~azure.mgmt.compute.v2022_07_02.models.KeyVaultAndSecretReference - :keyword key_encryption_key: Key Vault Key Url and vault id of the key encryption key. - KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. - :paramtype key_encryption_key: ~azure.mgmt.compute.v2022_07_02.models.KeyVaultAndKeyReference - """ - super().__init__(**kwargs) - self.disk_encryption_key = disk_encryption_key - self.key_encryption_key = key_encryption_key - - -class ExtendedLocation(_serialization.Model): - """The complex type of the extended location. - - :ivar name: The name of the extended location. - :vartype name: str - :ivar type: The type of the extended location. "EdgeZone" - :vartype type: str or ~azure.mgmt.compute.v2022_07_02.models.ExtendedLocationTypes - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = None, - **kwargs - ): - """ - :keyword name: The name of the extended location. - :paramtype name: str - :keyword type: The type of the extended location. "EdgeZone" - :paramtype type: str or ~azure.mgmt.compute.v2022_07_02.models.ExtendedLocationTypes - """ - super().__init__(**kwargs) - self.name = name - self.type = type - - -class GrantAccessData(_serialization.Model): - """Data used for requesting a SAS. - - All required parameters must be populated in order to send to Azure. - - :ivar access: Required. Known values are: "None", "Read", and "Write". - :vartype access: str or ~azure.mgmt.compute.v2022_07_02.models.AccessLevel - :ivar duration_in_seconds: Time duration in seconds until the SAS access expires. Required. - :vartype duration_in_seconds: int - :ivar get_secure_vm_guest_state_sas: Set this flag to true to get additional SAS for VM guest - state. - :vartype get_secure_vm_guest_state_sas: bool - """ - - _validation = { - "access": {"required": True}, - "duration_in_seconds": {"required": True}, - } - - _attribute_map = { - "access": {"key": "access", "type": "str"}, - "duration_in_seconds": {"key": "durationInSeconds", "type": "int"}, - "get_secure_vm_guest_state_sas": {"key": "getSecureVMGuestStateSAS", "type": "bool"}, - } - - def __init__( - self, - *, - access: Union[str, "_models.AccessLevel"], - duration_in_seconds: int, - get_secure_vm_guest_state_sas: Optional[bool] = None, - **kwargs - ): - """ - :keyword access: Required. Known values are: "None", "Read", and "Write". - :paramtype access: str or ~azure.mgmt.compute.v2022_07_02.models.AccessLevel - :keyword duration_in_seconds: Time duration in seconds until the SAS access expires. Required. - :paramtype duration_in_seconds: int - :keyword get_secure_vm_guest_state_sas: Set this flag to true to get additional SAS for VM - guest state. - :paramtype get_secure_vm_guest_state_sas: bool - """ - super().__init__(**kwargs) - self.access = access - self.duration_in_seconds = duration_in_seconds - self.get_secure_vm_guest_state_sas = get_secure_vm_guest_state_sas - - -class ImageDiskReference(_serialization.Model): - """The source image used for creating the disk. - - :ivar id: A relative uri containing either a Platform Image Repository, user image, or Azure - Compute Gallery image reference. - :vartype id: str - :ivar shared_gallery_image_id: A relative uri containing a direct shared Azure Compute Gallery - image reference. - :vartype shared_gallery_image_id: str - :ivar community_gallery_image_id: A relative uri containing a community Azure Compute Gallery - image reference. - :vartype community_gallery_image_id: str - :ivar lun: If the disk is created from an image's data disk, this is an index that indicates - which of the data disks in the image to use. For OS disks, this field is null. - :vartype lun: int - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "shared_gallery_image_id": {"key": "sharedGalleryImageId", "type": "str"}, - "community_gallery_image_id": {"key": "communityGalleryImageId", "type": "str"}, - "lun": {"key": "lun", "type": "int"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - shared_gallery_image_id: Optional[str] = None, - community_gallery_image_id: Optional[str] = None, - lun: Optional[int] = None, - **kwargs - ): - """ - :keyword id: A relative uri containing either a Platform Image Repository, user image, or Azure - Compute Gallery image reference. - :paramtype id: str - :keyword shared_gallery_image_id: A relative uri containing a direct shared Azure Compute - Gallery image reference. - :paramtype shared_gallery_image_id: str - :keyword community_gallery_image_id: A relative uri containing a community Azure Compute - Gallery image reference. - :paramtype community_gallery_image_id: str - :keyword lun: If the disk is created from an image's data disk, this is an index that indicates - which of the data disks in the image to use. For OS disks, this field is null. - :paramtype lun: int - """ - super().__init__(**kwargs) - self.id = id - self.shared_gallery_image_id = shared_gallery_image_id - self.community_gallery_image_id = community_gallery_image_id - self.lun = lun - - -class InnerError(_serialization.Model): - """Inner error details. - - :ivar exceptiontype: The exception type. - :vartype exceptiontype: str - :ivar errordetail: The internal error message or exception dump. - :vartype errordetail: str - """ - - _attribute_map = { - "exceptiontype": {"key": "exceptiontype", "type": "str"}, - "errordetail": {"key": "errordetail", "type": "str"}, - } - - def __init__(self, *, exceptiontype: Optional[str] = None, errordetail: Optional[str] = None, **kwargs): - """ - :keyword exceptiontype: The exception type. - :paramtype exceptiontype: str - :keyword errordetail: The internal error message or exception dump. - :paramtype errordetail: str - """ - super().__init__(**kwargs) - self.exceptiontype = exceptiontype - self.errordetail = errordetail - - -class KeyForDiskEncryptionSet(_serialization.Model): - """Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots. - - All required parameters must be populated in order to send to Azure. - - :ivar source_vault: Resource id of the KeyVault containing the key or secret. This property is - optional and cannot be used if the KeyVault subscription is not the same as the Disk Encryption - Set subscription. - :vartype source_vault: ~azure.mgmt.compute.v2022_07_02.models.SourceVault - :ivar key_url: Fully versioned Key Url pointing to a key in KeyVault. Version segment of the - Url is required regardless of rotationToLatestKeyVersionEnabled value. Required. - :vartype key_url: str - """ - - _validation = { - "key_url": {"required": True}, - } - - _attribute_map = { - "source_vault": {"key": "sourceVault", "type": "SourceVault"}, - "key_url": {"key": "keyUrl", "type": "str"}, - } - - def __init__(self, *, key_url: str, source_vault: Optional["_models.SourceVault"] = None, **kwargs): - """ - :keyword source_vault: Resource id of the KeyVault containing the key or secret. This property - is optional and cannot be used if the KeyVault subscription is not the same as the Disk - Encryption Set subscription. - :paramtype source_vault: ~azure.mgmt.compute.v2022_07_02.models.SourceVault - :keyword key_url: Fully versioned Key Url pointing to a key in KeyVault. Version segment of the - Url is required regardless of rotationToLatestKeyVersionEnabled value. Required. - :paramtype key_url: str - """ - super().__init__(**kwargs) - self.source_vault = source_vault - self.key_url = key_url - - -class KeyVaultAndKeyReference(_serialization.Model): - """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey. - - All required parameters must be populated in order to send to Azure. - - :ivar source_vault: Resource id of the KeyVault containing the key or secret. Required. - :vartype source_vault: ~azure.mgmt.compute.v2022_07_02.models.SourceVault - :ivar key_url: Url pointing to a key or secret in KeyVault. Required. - :vartype key_url: str - """ - - _validation = { - "source_vault": {"required": True}, - "key_url": {"required": True}, - } - - _attribute_map = { - "source_vault": {"key": "sourceVault", "type": "SourceVault"}, - "key_url": {"key": "keyUrl", "type": "str"}, - } - - def __init__(self, *, source_vault: "_models.SourceVault", key_url: str, **kwargs): - """ - :keyword source_vault: Resource id of the KeyVault containing the key or secret. Required. - :paramtype source_vault: ~azure.mgmt.compute.v2022_07_02.models.SourceVault - :keyword key_url: Url pointing to a key or secret in KeyVault. Required. - :paramtype key_url: str - """ - super().__init__(**kwargs) - self.source_vault = source_vault - self.key_url = key_url - - -class KeyVaultAndSecretReference(_serialization.Model): - """Key Vault Secret Url and vault id of the encryption key. - - All required parameters must be populated in order to send to Azure. - - :ivar source_vault: Resource id of the KeyVault containing the key or secret. Required. - :vartype source_vault: ~azure.mgmt.compute.v2022_07_02.models.SourceVault - :ivar secret_url: Url pointing to a key or secret in KeyVault. Required. - :vartype secret_url: str - """ - - _validation = { - "source_vault": {"required": True}, - "secret_url": {"required": True}, - } - - _attribute_map = { - "source_vault": {"key": "sourceVault", "type": "SourceVault"}, - "secret_url": {"key": "secretUrl", "type": "str"}, - } - - def __init__(self, *, source_vault: "_models.SourceVault", secret_url: str, **kwargs): - """ - :keyword source_vault: Resource id of the KeyVault containing the key or secret. Required. - :paramtype source_vault: ~azure.mgmt.compute.v2022_07_02.models.SourceVault - :keyword secret_url: Url pointing to a key or secret in KeyVault. Required. - :paramtype secret_url: str - """ - super().__init__(**kwargs) - self.source_vault = source_vault - self.secret_url = secret_url - - -class PrivateEndpoint(_serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - "id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(_serialization.Model): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: private endpoint connection Id. - :vartype id: str - :ivar name: private endpoint connection name. - :vartype name: str - :ivar type: private endpoint connection type. - :vartype type: str - :ivar private_endpoint: The resource of private end point. - :vartype private_endpoint: ~azure.mgmt.compute.v2022_07_02.models.PrivateEndpoint - :ivar private_link_service_connection_state: A collection of information about the state of the - connection between DiskAccess and Virtual Network. - :vartype private_link_service_connection_state: - ~azure.mgmt.compute.v2022_07_02.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The provisioning state of the private endpoint connection resource. - Known values are: "Succeeded", "Creating", "Deleting", and "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "private_endpoint": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, - "private_link_service_connection_state": { - "key": "properties.privateLinkServiceConnectionState", - "type": "PrivateLinkServiceConnectionState", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, - **kwargs - ): - """ - :keyword private_link_service_connection_state: A collection of information about the state of - the connection between DiskAccess and Virtual Network. - :paramtype private_link_service_connection_state: - ~azure.mgmt.compute.v2022_07_02.models.PrivateLinkServiceConnectionState - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.private_endpoint = None - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = None - - -class PrivateEndpointConnectionListResult(_serialization.Model): - """A list of private link resources. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :ivar next_link: The uri to fetch the next page of snapshots. Call ListNext() with this to - fetch the next page of snapshots. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.PrivateEndpointConnection"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :keyword next_link: The uri to fetch the next page of snapshots. Call ListNext() with this to - fetch the next page of snapshots. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PrivateLinkResource(_serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: private link resource Id. - :vartype id: str - :ivar name: private link resource name. - :vartype name: str - :ivar type: private link resource type. - :vartype type: str - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "group_id": {"readonly": True}, - "required_members": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "group_id": {"key": "properties.groupId", "type": "str"}, - "required_members": {"key": "properties.requiredMembers", "type": "[str]"}, - "required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"}, - } - - def __init__(self, *, required_zone_names: Optional[List[str]] = None, **kwargs): - """ - :keyword required_zone_names: The private link resource DNS zone name. - :paramtype required_zone_names: list[str] - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.group_id = None - self.required_members = None - self.required_zone_names = required_zone_names - - -class PrivateLinkResourceListResult(_serialization.Model): - """A list of private link resources. - - :ivar value: Array of private link resources. - :vartype value: list[~azure.mgmt.compute.v2022_07_02.models.PrivateLinkResource] - """ - - _attribute_map = { - "value": {"key": "value", "type": "[PrivateLinkResource]"}, - } - - def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs): - """ - :keyword value: Array of private link resources. - :paramtype value: list[~azure.mgmt.compute.v2022_07_02.models.PrivateLinkResource] - """ - super().__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(_serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Known values are: "Pending", "Approved", and "Rejected". - :vartype status: str or - ~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointServiceConnectionStatus - :ivar description: The reason for approval/rejection of the connection. - :vartype description: str - :ivar actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :vartype actions_required: str - """ - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "actions_required": {"key": "actionsRequired", "type": "str"}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = None, - description: Optional[str] = None, - actions_required: Optional[str] = None, - **kwargs - ): - """ - :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Known values are: "Pending", "Approved", and "Rejected". - :paramtype status: str or - ~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointServiceConnectionStatus - :keyword description: The reason for approval/rejection of the connection. - :paramtype description: str - :keyword actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :paramtype actions_required: str - """ - super().__init__(**kwargs) - self.status = status - self.description = description - self.actions_required = actions_required - - -class PropertyUpdatesInProgress(_serialization.Model): - """Properties of the disk for which update is pending. - - :ivar target_tier: The target performance tier of the disk if a tier change operation is in - progress. - :vartype target_tier: str - """ - - _attribute_map = { - "target_tier": {"key": "targetTier", "type": "str"}, - } - - def __init__(self, *, target_tier: Optional[str] = None, **kwargs): - """ - :keyword target_tier: The target performance tier of the disk if a tier change operation is in - progress. - :paramtype target_tier: str - """ - super().__init__(**kwargs) - self.target_tier = target_tier - - -class PurchasePlan(_serialization.Model): - """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The plan ID. Required. - :vartype name: str - :ivar publisher: The publisher ID. Required. - :vartype publisher: str - :ivar product: Specifies the product of the image from the marketplace. This is the same value - as Offer under the imageReference element. Required. - :vartype product: str - :ivar promotion_code: The Offer Promotion Code. - :vartype promotion_code: str - """ - - _validation = { - "name": {"required": True}, - "publisher": {"required": True}, - "product": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "publisher": {"key": "publisher", "type": "str"}, - "product": {"key": "product", "type": "str"}, - "promotion_code": {"key": "promotionCode", "type": "str"}, - } - - def __init__(self, *, name: str, publisher: str, product: str, promotion_code: Optional[str] = None, **kwargs): - """ - :keyword name: The plan ID. Required. - :paramtype name: str - :keyword publisher: The publisher ID. Required. - :paramtype publisher: str - :keyword product: Specifies the product of the image from the marketplace. This is the same - value as Offer under the imageReference element. Required. - :paramtype product: str - :keyword promotion_code: The Offer Promotion Code. - :paramtype promotion_code: str - """ - super().__init__(**kwargs) - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code - - -class ResourceUriList(_serialization.Model): - """The List resources which are encrypted with the disk encryption set. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of IDs or Owner IDs of resources which are encrypted with the disk - encryption set. Required. - :vartype value: list[str] - :ivar next_link: The uri to fetch the next page of encrypted resources. Call ListNext() with - this to fetch the next page of encrypted resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[str]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List[str], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of IDs or Owner IDs of resources which are encrypted with the disk - encryption set. Required. - :paramtype value: list[str] - :keyword next_link: The uri to fetch the next page of encrypted resources. Call ListNext() with - this to fetch the next page of encrypted resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ResourceWithOptionalLocation(_serialization.Model): - """The Resource model definition with location property as optional. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: Resource location. - :vartype location: str - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs): - """ - :keyword location: Resource location. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.location = location - self.id = None - self.name = None - self.type = None - self.tags = tags - - -class ShareInfoElement(_serialization.Model): - """ShareInfoElement. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_uri: A relative URI containing the ID of the VM that has the disk attached. - :vartype vm_uri: str - """ - - _validation = { - "vm_uri": {"readonly": True}, - } - - _attribute_map = { - "vm_uri": {"key": "vmUri", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.vm_uri = None - - -class Snapshot(Resource): # pylint: disable=too-many-instance-attributes - """Snapshot resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar managed_by: Unused. Always Null. - :vartype managed_by: str - :ivar sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is - an optional parameter for incremental snapshot and the default behavior is the SKU will be set - to the same sku as the previous snapshot. - :vartype sku: ~azure.mgmt.compute.v2022_07_02.models.SnapshotSku - :ivar extended_location: The extended location where the snapshot will be created. Extended - location cannot be changed. - :vartype extended_location: ~azure.mgmt.compute.v2022_07_02.models.ExtendedLocation - :ivar time_created: The time when the snapshot was created. - :vartype time_created: ~datetime.datetime - :ivar os_type: The Operating System type. Known values are: "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2022_07_02.models.OperatingSystemTypes - :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :vartype hyper_v_generation: str or ~azure.mgmt.compute.v2022_07_02.models.HyperVGeneration - :ivar purchase_plan: Purchase plan information for the image from which the source disk for the - snapshot was originally created. - :vartype purchase_plan: ~azure.mgmt.compute.v2022_07_02.models.PurchasePlan - :ivar supported_capabilities: List of supported capabilities for the image from which the - source disk from the snapshot was originally created. - :vartype supported_capabilities: ~azure.mgmt.compute.v2022_07_02.models.SupportedCapabilities - :ivar creation_data: Disk source information. CreationData information cannot be changed after - the disk has been created. - :vartype creation_data: ~azure.mgmt.compute.v2022_07_02.models.CreationData - :ivar disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :vartype disk_size_gb: int - :ivar disk_size_bytes: The size of the disk in bytes. This field is read only. - :vartype disk_size_bytes: int - :ivar disk_state: The state of the snapshot. Known values are: "Unattached", "Attached", - "Reserved", "Frozen", "ActiveSAS", "ActiveSASFrozen", "ReadyToUpload", and "ActiveUpload". - :vartype disk_state: str or ~azure.mgmt.compute.v2022_07_02.models.DiskState - :ivar unique_id: Unique Guid identifying the resource. - :vartype unique_id: str - :ivar encryption_settings_collection: Encryption settings collection used be Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :vartype encryption_settings_collection: - ~azure.mgmt.compute.v2022_07_02.models.EncryptionSettingsCollection - :ivar provisioning_state: The disk provisioning state. - :vartype provisioning_state: str - :ivar incremental: Whether a snapshot is incremental. Incremental snapshots on the same disk - occupy less space than full snapshots and can be diffed. - :vartype incremental: bool - :ivar incremental_snapshot_family_id: Incremental snapshots for a disk share an incremental - snapshot family id. The Get Page Range Diff API can only be called on incremental snapshots - with the same family id. - :vartype incremental_snapshot_family_id: str - :ivar encryption: Encryption property can be used to encrypt data at rest with customer managed - keys or platform managed keys. - :vartype encryption: ~azure.mgmt.compute.v2022_07_02.models.Encryption - :ivar network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :vartype network_access_policy: str or - ~azure.mgmt.compute.v2022_07_02.models.NetworkAccessPolicy - :ivar disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. - :vartype disk_access_id: str - :ivar security_profile: Contains the security related information for the resource. - :vartype security_profile: ~azure.mgmt.compute.v2022_07_02.models.DiskSecurityProfile - :ivar supports_hibernation: Indicates the OS on a snapshot supports hibernation. - :vartype supports_hibernation: bool - :ivar public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.compute.v2022_07_02.models.PublicNetworkAccess - :ivar completion_percent: Percentage complete for the background copy when a resource is - created via the CopyStart operation. - :vartype completion_percent: float - :ivar copy_completion_error: Indicates the error details if the background copy of a resource - created via the CopyStart operation fails. - :vartype copy_completion_error: ~azure.mgmt.compute.v2022_07_02.models.CopyCompletionError - :ivar data_access_auth_mode: Additional authentication requirements when exporting or uploading - to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :vartype data_access_auth_mode: str or - ~azure.mgmt.compute.v2022_07_02.models.DataAccessAuthMode - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "managed_by": {"readonly": True}, - "time_created": {"readonly": True}, - "disk_size_bytes": {"readonly": True}, - "disk_state": {"readonly": True}, - "unique_id": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "incremental_snapshot_family_id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "managed_by": {"key": "managedBy", "type": "str"}, - "sku": {"key": "sku", "type": "SnapshotSku"}, - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, - "time_created": {"key": "properties.timeCreated", "type": "iso-8601"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, - "purchase_plan": {"key": "properties.purchasePlan", "type": "PurchasePlan"}, - "supported_capabilities": {"key": "properties.supportedCapabilities", "type": "SupportedCapabilities"}, - "creation_data": {"key": "properties.creationData", "type": "CreationData"}, - "disk_size_gb": {"key": "properties.diskSizeGB", "type": "int"}, - "disk_size_bytes": {"key": "properties.diskSizeBytes", "type": "int"}, - "disk_state": {"key": "properties.diskState", "type": "str"}, - "unique_id": {"key": "properties.uniqueId", "type": "str"}, - "encryption_settings_collection": { - "key": "properties.encryptionSettingsCollection", - "type": "EncryptionSettingsCollection", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "incremental": {"key": "properties.incremental", "type": "bool"}, - "incremental_snapshot_family_id": {"key": "properties.incrementalSnapshotFamilyId", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "Encryption"}, - "network_access_policy": {"key": "properties.networkAccessPolicy", "type": "str"}, - "disk_access_id": {"key": "properties.diskAccessId", "type": "str"}, - "security_profile": {"key": "properties.securityProfile", "type": "DiskSecurityProfile"}, - "supports_hibernation": {"key": "properties.supportsHibernation", "type": "bool"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "completion_percent": {"key": "properties.completionPercent", "type": "float"}, - "copy_completion_error": {"key": "properties.copyCompletionError", "type": "CopyCompletionError"}, - "data_access_auth_mode": {"key": "properties.dataAccessAuthMode", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - sku: Optional["_models.SnapshotSku"] = None, - extended_location: Optional["_models.ExtendedLocation"] = None, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, - purchase_plan: Optional["_models.PurchasePlan"] = None, - supported_capabilities: Optional["_models.SupportedCapabilities"] = None, - creation_data: Optional["_models.CreationData"] = None, - disk_size_gb: Optional[int] = None, - encryption_settings_collection: Optional["_models.EncryptionSettingsCollection"] = None, - incremental: Optional[bool] = None, - encryption: Optional["_models.Encryption"] = None, - network_access_policy: Optional[Union[str, "_models.NetworkAccessPolicy"]] = None, - disk_access_id: Optional[str] = None, - security_profile: Optional["_models.DiskSecurityProfile"] = None, - supports_hibernation: Optional[bool] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - completion_percent: Optional[float] = None, - copy_completion_error: Optional["_models.CopyCompletionError"] = None, - data_access_auth_mode: Optional[Union[str, "_models.DataAccessAuthMode"]] = None, - **kwargs - ): - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This - is an optional parameter for incremental snapshot and the default behavior is the SKU will be - set to the same sku as the previous snapshot. - :paramtype sku: ~azure.mgmt.compute.v2022_07_02.models.SnapshotSku - :keyword extended_location: The extended location where the snapshot will be created. Extended - location cannot be changed. - :paramtype extended_location: ~azure.mgmt.compute.v2022_07_02.models.ExtendedLocation - :keyword os_type: The Operating System type. Known values are: "Windows" and "Linux". - :paramtype os_type: str or ~azure.mgmt.compute.v2022_07_02.models.OperatingSystemTypes - :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Known values are: "V1" and "V2". - :paramtype hyper_v_generation: str or ~azure.mgmt.compute.v2022_07_02.models.HyperVGeneration - :keyword purchase_plan: Purchase plan information for the image from which the source disk for - the snapshot was originally created. - :paramtype purchase_plan: ~azure.mgmt.compute.v2022_07_02.models.PurchasePlan - :keyword supported_capabilities: List of supported capabilities for the image from which the - source disk from the snapshot was originally created. - :paramtype supported_capabilities: ~azure.mgmt.compute.v2022_07_02.models.SupportedCapabilities - :keyword creation_data: Disk source information. CreationData information cannot be changed - after the disk has been created. - :paramtype creation_data: ~azure.mgmt.compute.v2022_07_02.models.CreationData - :keyword disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :paramtype disk_size_gb: int - :keyword encryption_settings_collection: Encryption settings collection used be Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :paramtype encryption_settings_collection: - ~azure.mgmt.compute.v2022_07_02.models.EncryptionSettingsCollection - :keyword incremental: Whether a snapshot is incremental. Incremental snapshots on the same disk - occupy less space than full snapshots and can be diffed. - :paramtype incremental: bool - :keyword encryption: Encryption property can be used to encrypt data at rest with customer - managed keys or platform managed keys. - :paramtype encryption: ~azure.mgmt.compute.v2022_07_02.models.Encryption - :keyword network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :paramtype network_access_policy: str or - ~azure.mgmt.compute.v2022_07_02.models.NetworkAccessPolicy - :keyword disk_access_id: ARM id of the DiskAccess resource for using private endpoints on - disks. - :paramtype disk_access_id: str - :keyword security_profile: Contains the security related information for the resource. - :paramtype security_profile: ~azure.mgmt.compute.v2022_07_02.models.DiskSecurityProfile - :keyword supports_hibernation: Indicates the OS on a snapshot supports hibernation. - :paramtype supports_hibernation: bool - :keyword public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.compute.v2022_07_02.models.PublicNetworkAccess - :keyword completion_percent: Percentage complete for the background copy when a resource is - created via the CopyStart operation. - :paramtype completion_percent: float - :keyword copy_completion_error: Indicates the error details if the background copy of a - resource created via the CopyStart operation fails. - :paramtype copy_completion_error: ~azure.mgmt.compute.v2022_07_02.models.CopyCompletionError - :keyword data_access_auth_mode: Additional authentication requirements when exporting or - uploading to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :paramtype data_access_auth_mode: str or - ~azure.mgmt.compute.v2022_07_02.models.DataAccessAuthMode - """ - super().__init__(location=location, tags=tags, **kwargs) - self.managed_by = None - self.sku = sku - self.extended_location = extended_location - self.time_created = None - self.os_type = os_type - self.hyper_v_generation = hyper_v_generation - self.purchase_plan = purchase_plan - self.supported_capabilities = supported_capabilities - self.creation_data = creation_data - self.disk_size_gb = disk_size_gb - self.disk_size_bytes = None - self.disk_state = None - self.unique_id = None - self.encryption_settings_collection = encryption_settings_collection - self.provisioning_state = None - self.incremental = incremental - self.incremental_snapshot_family_id = None - self.encryption = encryption - self.network_access_policy = network_access_policy - self.disk_access_id = disk_access_id - self.security_profile = security_profile - self.supports_hibernation = supports_hibernation - self.public_network_access = public_network_access - self.completion_percent = completion_percent - self.copy_completion_error = copy_completion_error - self.data_access_auth_mode = data_access_auth_mode - - -class SnapshotList(_serialization.Model): - """The List Snapshots operation response. - - All required parameters must be populated in order to send to Azure. - - :ivar value: A list of snapshots. Required. - :vartype value: list[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :ivar next_link: The uri to fetch the next page of snapshots. Call ListNext() with this to - fetch the next page of snapshots. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Snapshot]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Snapshot"], next_link: Optional[str] = None, **kwargs): - """ - :keyword value: A list of snapshots. Required. - :paramtype value: list[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :keyword next_link: The uri to fetch the next page of snapshots. Call ListNext() with this to - fetch the next page of snapshots. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SnapshotSku(_serialization.Model): - """The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The sku name. Known values are: "Standard_LRS", "Premium_LRS", and "Standard_ZRS". - :vartype name: str or ~azure.mgmt.compute.v2022_07_02.models.SnapshotStorageAccountTypes - :ivar tier: The sku tier. - :vartype tier: str - """ - - _validation = { - "tier": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - } - - def __init__(self, *, name: Optional[Union[str, "_models.SnapshotStorageAccountTypes"]] = None, **kwargs): - """ - :keyword name: The sku name. Known values are: "Standard_LRS", "Premium_LRS", and - "Standard_ZRS". - :paramtype name: str or ~azure.mgmt.compute.v2022_07_02.models.SnapshotStorageAccountTypes - """ - super().__init__(**kwargs) - self.name = name - self.tier = None - - -class SnapshotUpdate(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Snapshot update resource. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is - an optional parameter for incremental snapshot and the default behavior is the SKU will be set - to the same sku as the previous snapshot. - :vartype sku: ~azure.mgmt.compute.v2022_07_02.models.SnapshotSku - :ivar os_type: the Operating System type. Known values are: "Windows" and "Linux". - :vartype os_type: str or ~azure.mgmt.compute.v2022_07_02.models.OperatingSystemTypes - :ivar disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :vartype disk_size_gb: int - :ivar encryption_settings_collection: Encryption settings collection used be Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :vartype encryption_settings_collection: - ~azure.mgmt.compute.v2022_07_02.models.EncryptionSettingsCollection - :ivar encryption: Encryption property can be used to encrypt data at rest with customer managed - keys or platform managed keys. - :vartype encryption: ~azure.mgmt.compute.v2022_07_02.models.Encryption - :ivar network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :vartype network_access_policy: str or - ~azure.mgmt.compute.v2022_07_02.models.NetworkAccessPolicy - :ivar disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. - :vartype disk_access_id: str - :ivar supports_hibernation: Indicates the OS on a snapshot supports hibernation. - :vartype supports_hibernation: bool - :ivar public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.compute.v2022_07_02.models.PublicNetworkAccess - :ivar data_access_auth_mode: Additional authentication requirements when exporting or uploading - to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :vartype data_access_auth_mode: str or - ~azure.mgmt.compute.v2022_07_02.models.DataAccessAuthMode - :ivar supported_capabilities: List of supported capabilities for the image from which the OS - disk was created. - :vartype supported_capabilities: ~azure.mgmt.compute.v2022_07_02.models.SupportedCapabilities - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "SnapshotSku"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "disk_size_gb": {"key": "properties.diskSizeGB", "type": "int"}, - "encryption_settings_collection": { - "key": "properties.encryptionSettingsCollection", - "type": "EncryptionSettingsCollection", - }, - "encryption": {"key": "properties.encryption", "type": "Encryption"}, - "network_access_policy": {"key": "properties.networkAccessPolicy", "type": "str"}, - "disk_access_id": {"key": "properties.diskAccessId", "type": "str"}, - "supports_hibernation": {"key": "properties.supportsHibernation", "type": "bool"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "data_access_auth_mode": {"key": "properties.dataAccessAuthMode", "type": "str"}, - "supported_capabilities": {"key": "properties.supportedCapabilities", "type": "SupportedCapabilities"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["_models.SnapshotSku"] = None, - os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, - disk_size_gb: Optional[int] = None, - encryption_settings_collection: Optional["_models.EncryptionSettingsCollection"] = None, - encryption: Optional["_models.Encryption"] = None, - network_access_policy: Optional[Union[str, "_models.NetworkAccessPolicy"]] = None, - disk_access_id: Optional[str] = None, - supports_hibernation: Optional[bool] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - data_access_auth_mode: Optional[Union[str, "_models.DataAccessAuthMode"]] = None, - supported_capabilities: Optional["_models.SupportedCapabilities"] = None, - **kwargs - ): - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This - is an optional parameter for incremental snapshot and the default behavior is the SKU will be - set to the same sku as the previous snapshot. - :paramtype sku: ~azure.mgmt.compute.v2022_07_02.models.SnapshotSku - :keyword os_type: the Operating System type. Known values are: "Windows" and "Linux". - :paramtype os_type: str or ~azure.mgmt.compute.v2022_07_02.models.OperatingSystemTypes - :keyword disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it - indicates the size of the disk to create. If this field is present for updates or creation with - other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a - running VM, and can only increase the disk's size. - :paramtype disk_size_gb: int - :keyword encryption_settings_collection: Encryption settings collection used be Azure Disk - Encryption, can contain multiple encryption settings per disk or snapshot. - :paramtype encryption_settings_collection: - ~azure.mgmt.compute.v2022_07_02.models.EncryptionSettingsCollection - :keyword encryption: Encryption property can be used to encrypt data at rest with customer - managed keys or platform managed keys. - :paramtype encryption: ~azure.mgmt.compute.v2022_07_02.models.Encryption - :keyword network_access_policy: Policy for accessing the disk via network. Known values are: - "AllowAll", "AllowPrivate", and "DenyAll". - :paramtype network_access_policy: str or - ~azure.mgmt.compute.v2022_07_02.models.NetworkAccessPolicy - :keyword disk_access_id: ARM id of the DiskAccess resource for using private endpoints on - disks. - :paramtype disk_access_id: str - :keyword supports_hibernation: Indicates the OS on a snapshot supports hibernation. - :paramtype supports_hibernation: bool - :keyword public_network_access: Policy for controlling export on the disk. Known values are: - "Enabled" and "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.compute.v2022_07_02.models.PublicNetworkAccess - :keyword data_access_auth_mode: Additional authentication requirements when exporting or - uploading to a disk or snapshot. Known values are: "AzureActiveDirectory" and "None". - :paramtype data_access_auth_mode: str or - ~azure.mgmt.compute.v2022_07_02.models.DataAccessAuthMode - :keyword supported_capabilities: List of supported capabilities for the image from which the OS - disk was created. - :paramtype supported_capabilities: ~azure.mgmt.compute.v2022_07_02.models.SupportedCapabilities - """ - super().__init__(**kwargs) - self.tags = tags - self.sku = sku - self.os_type = os_type - self.disk_size_gb = disk_size_gb - self.encryption_settings_collection = encryption_settings_collection - self.encryption = encryption - self.network_access_policy = network_access_policy - self.disk_access_id = disk_access_id - self.supports_hibernation = supports_hibernation - self.public_network_access = public_network_access - self.data_access_auth_mode = data_access_auth_mode - self.supported_capabilities = supported_capabilities - - -class SourceVault(_serialization.Model): - """The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. - - :ivar id: Resource Id. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin - """ - :keyword id: Resource Id. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class SubResource(_serialization.Model): - """SubResource. - - :ivar id: Resource Id. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin - """ - :keyword id: Resource Id. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class SubResourceReadOnly(_serialization.Model): - """SubResourceReadOnly. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - """ - - _validation = { - "id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.id = None - - -class SupportedCapabilities(_serialization.Model): - """List of supported capabilities persisted on the disk resource for VM use. - - :ivar disk_controller_types: The disk controllers that an OS disk supports. If set it can be - SCSI or SCSI, NVME or NVME, SCSI. - :vartype disk_controller_types: str - :ivar accelerated_network: True if the image from which the OS disk is created supports - accelerated networking. - :vartype accelerated_network: bool - :ivar architecture: CPU architecture supported by an OS disk. Known values are: "x64" and - "Arm64". - :vartype architecture: str or ~azure.mgmt.compute.v2022_07_02.models.Architecture - """ - - _attribute_map = { - "disk_controller_types": {"key": "diskControllerTypes", "type": "str"}, - "accelerated_network": {"key": "acceleratedNetwork", "type": "bool"}, - "architecture": {"key": "architecture", "type": "str"}, - } - - def __init__( - self, - *, - disk_controller_types: Optional[str] = None, - accelerated_network: Optional[bool] = None, - architecture: Optional[Union[str, "_models.Architecture"]] = None, - **kwargs - ): - """ - :keyword disk_controller_types: The disk controllers that an OS disk supports. If set it can be - SCSI or SCSI, NVME or NVME, SCSI. - :paramtype disk_controller_types: str - :keyword accelerated_network: True if the image from which the OS disk is created supports - accelerated networking. - :paramtype accelerated_network: bool - :keyword architecture: CPU architecture supported by an OS disk. Known values are: "x64" and - "Arm64". - :paramtype architecture: str or ~azure.mgmt.compute.v2022_07_02.models.Architecture - """ - super().__init__(**kwargs) - self.disk_controller_types = disk_controller_types - self.accelerated_network = accelerated_network - self.architecture = architecture - - -class UserAssignedIdentitiesValue(_serialization.Model): - """UserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - "principal_id": {"readonly": True}, - "client_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.principal_id = None - self.client_id = None diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_patch.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/__init__.py deleted file mode 100644 index b013687c8bd2..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._disks_operations import DisksOperations -from ._disk_accesses_operations import DiskAccessesOperations -from ._disk_encryption_sets_operations import DiskEncryptionSetsOperations -from ._disk_restore_point_operations import DiskRestorePointOperations -from ._snapshots_operations import SnapshotsOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DisksOperations", - "DiskAccessesOperations", - "DiskEncryptionSetsOperations", - "DiskRestorePointOperations", - "SnapshotsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_accesses_operations.py deleted file mode 100644 index 93840703f28f..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_accesses_operations.py +++ /dev/null @@ -1,1759 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, disk_access_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskAccessName": _SERIALIZER.url("disk_access_name", disk_access_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, disk_access_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskAccessName": _SERIALIZER.url("disk_access_name", disk_access_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, disk_access_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskAccessName": _SERIALIZER.url("disk_access_name", disk_access_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, disk_access_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskAccessName": _SERIALIZER.url("disk_access_name", disk_access_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_private_link_resources_request( - resource_group_name: str, disk_access_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskAccessName": _SERIALIZER.url("disk_access_name", disk_access_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_a_private_endpoint_connection_request( - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskAccessName": _SERIALIZER.url("disk_access_name", disk_access_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_a_private_endpoint_connection_request( - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskAccessName": _SERIALIZER.url("disk_access_name", disk_access_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_a_private_endpoint_connection_request( - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskAccessName": _SERIALIZER.url("disk_access_name", disk_access_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_private_endpoint_connections_request( - resource_group_name: str, disk_access_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskAccessName": _SERIALIZER.url("disk_access_name", disk_access_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DiskAccessesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_07_02.ComputeManagementClient`'s - :attr:`disk_accesses` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_or_update_initial( - self, resource_group_name: str, disk_access_name: str, disk_access: Union[_models.DiskAccess, IO], **kwargs: Any - ) -> _models.DiskAccess: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk_access, (IO, bytes)): - _content = disk_access - else: - _json = self._serialize.body(disk_access, "DiskAccess") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DiskAccess", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("DiskAccess", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: _models.DiskAccess, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiskAccess]: - """Creates or updates a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Put disk access operation. - Required. - :type disk_access: ~azure.mgmt.compute.v2022_07_02.models.DiskAccess - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskAccess or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiskAccess]: - """Creates or updates a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Put disk access operation. - Required. - :type disk_access: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskAccess or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, resource_group_name: str, disk_access_name: str, disk_access: Union[_models.DiskAccess, IO], **kwargs: Any - ) -> LROPoller[_models.DiskAccess]: - """Creates or updates a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Put disk access operation. - Is either a model type or a IO type. Required. - :type disk_access: ~azure.mgmt.compute.v2022_07_02.models.DiskAccess or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskAccess or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - disk_access=disk_access, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DiskAccess", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - def _update_initial( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: Union[_models.DiskAccessUpdate, IO], - **kwargs: Any - ) -> _models.DiskAccess: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk_access, (IO, bytes)): - _content = disk_access - else: - _json = self._serialize.body(disk_access, "DiskAccessUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DiskAccess", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("DiskAccess", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: _models.DiskAccessUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiskAccess]: - """Updates (patches) a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Patch disk access operation. - Required. - :type disk_access: ~azure.mgmt.compute.v2022_07_02.models.DiskAccessUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskAccess or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiskAccess]: - """Updates (patches) a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Patch disk access operation. - Required. - :type disk_access: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskAccess or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - disk_access_name: str, - disk_access: Union[_models.DiskAccessUpdate, IO], - **kwargs: Any - ) -> LROPoller[_models.DiskAccess]: - """Updates (patches) a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param disk_access: disk access object supplied in the body of the Patch disk access operation. - Is either a model type or a IO type. Required. - :type disk_access: ~azure.mgmt.compute.v2022_07_02.models.DiskAccessUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskAccess or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - disk_access=disk_access, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DiskAccess", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> _models.DiskAccess: - """Gets information about a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DiskAccess or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.DiskAccess - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] - - request = build_get_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DiskAccess", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, disk_access_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"} # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.DiskAccess"]: - """Lists all the disk access resources under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DiskAccess or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DiskAccessList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses"} # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: - """Lists all the disk access resources under a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DiskAccess or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_07_02.models.DiskAccess] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DiskAccessList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses"} # type: ignore - - @distributed_trace - def get_private_link_resources( - self, resource_group_name: str, disk_access_name: str, **kwargs: Any - ) -> _models.PrivateLinkResourceListResult: - """Gets the private link resources possible under disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkResourceListResult or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.PrivateLinkResourceListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] - - request = build_get_private_link_resources_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_private_link_resources.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_private_link_resources.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources"} # type: ignore - - def _update_a_private_endpoint_connection_initial( - self, - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: Union[_models.PrivateEndpointConnection, IO], - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(private_endpoint_connection, (IO, bytes)): - _content = private_endpoint_connection - else: - _json = self._serialize.body(private_endpoint_connection, "PrivateEndpointConnection") - - request = build_update_a_private_endpoint_connection_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_a_private_endpoint_connection_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_a_private_endpoint_connection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - @overload - def begin_update_a_private_endpoint_connection( - self, - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection under disk access resource, this can't be used - to create a new private endpoint connection. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: private endpoint connection object supplied in the body of - the Put private endpoint connection operation. Required. - :type private_endpoint_connection: - ~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_a_private_endpoint_connection( - self, - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection under disk access resource, this can't be used - to create a new private endpoint connection. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: private endpoint connection object supplied in the body of - the Put private endpoint connection operation. Required. - :type private_endpoint_connection: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_a_private_endpoint_connection( - self, - resource_group_name: str, - disk_access_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection: Union[_models.PrivateEndpointConnection, IO], - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection under disk access resource, this can't be used - to create a new private endpoint connection. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: private endpoint connection object supplied in the body of - the Put private endpoint connection operation. Is either a model type or a IO type. Required. - :type private_endpoint_connection: - ~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - 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] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_a_private_endpoint_connection_initial( # type: ignore - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - private_endpoint_connection_name=private_endpoint_connection_name, - private_endpoint_connection=private_endpoint_connection, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update_a_private_endpoint_connection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - @distributed_trace - def get_a_private_endpoint_connection( - self, resource_group_name: str, disk_access_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Gets information about a private endpoint connection under a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - - request = build_get_a_private_endpoint_connection_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_a_private_endpoint_connection.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_a_private_endpoint_connection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - def _delete_a_private_endpoint_connection_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, disk_access_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_a_private_endpoint_connection_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_a_private_endpoint_connection_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_a_private_endpoint_connection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - @distributed_trace - def begin_delete_a_private_endpoint_connection( - self, resource_group_name: str, disk_access_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a private endpoint connection under a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_a_private_endpoint_connection_initial( # type: ignore - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_a_private_endpoint_connection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - @distributed_trace - def list_private_endpoint_connections( - self, resource_group_name: str, disk_access_name: str, **kwargs: Any - ) -> Iterable["_models.PrivateEndpointConnection"]: - """List information about private endpoint connections under a disk access resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_access_name: The name of the disk access resource that is being created. The name - can't be changed after the disk encryption set is created. Supported characters for the name - are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_access_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnection or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_07_02.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_private_endpoint_connections_request( - resource_group_name=resource_group_name, - disk_access_name=disk_access_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_private_endpoint_connections.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - 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) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_private_endpoint_connections.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_encryption_sets_operations.py deleted file mode 100644 index 02f4b9787ce5..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_encryption_sets_operations.py +++ /dev/null @@ -1,1138 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, disk_encryption_set_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskEncryptionSetName": _SERIALIZER.url("disk_encryption_set_name", disk_encryption_set_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, disk_encryption_set_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskEncryptionSetName": _SERIALIZER.url("disk_encryption_set_name", disk_encryption_set_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, disk_encryption_set_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskEncryptionSetName": _SERIALIZER.url("disk_encryption_set_name", disk_encryption_set_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, disk_encryption_set_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskEncryptionSetName": _SERIALIZER.url("disk_encryption_set_name", disk_encryption_set_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_associated_resources_request( - resource_group_name: str, disk_encryption_set_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskEncryptionSetName": _SERIALIZER.url("disk_encryption_set_name", disk_encryption_set_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DiskEncryptionSetsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_07_02.ComputeManagementClient`'s - :attr:`disk_encryption_sets` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_or_update_initial( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: Union[_models.DiskEncryptionSet, IO], - **kwargs: Any - ) -> _models.DiskEncryptionSet: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk_encryption_set, (IO, bytes)): - _content = disk_encryption_set - else: - _json = self._serialize.body(disk_encryption_set, "DiskEncryptionSet") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: _models.DiskEncryptionSet, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiskEncryptionSet]: - """Creates or updates a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Put disk - encryption set operation. Required. - :type disk_encryption_set: ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiskEncryptionSet]: - """Creates or updates a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Put disk - encryption set operation. Required. - :type disk_encryption_set: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: Union[_models.DiskEncryptionSet, IO], - **kwargs: Any - ) -> LROPoller[_models.DiskEncryptionSet]: - """Creates or updates a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Put disk - encryption set operation. Is either a model type or a IO type. Required. - :type disk_encryption_set: ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - disk_encryption_set=disk_encryption_set, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - def _update_initial( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: Union[_models.DiskEncryptionSetUpdate, IO], - **kwargs: Any - ) -> _models.DiskEncryptionSet: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk_encryption_set, (IO, bytes)): - _content = disk_encryption_set - else: - _json = self._serialize.body(disk_encryption_set, "DiskEncryptionSetUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: _models.DiskEncryptionSetUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiskEncryptionSet]: - """Updates (patches) a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Patch disk - encryption set operation. Required. - :type disk_encryption_set: ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSetUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiskEncryptionSet]: - """Updates (patches) a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Patch disk - encryption set operation. Required. - :type disk_encryption_set: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - disk_encryption_set_name: str, - disk_encryption_set: Union[_models.DiskEncryptionSetUpdate, IO], - **kwargs: Any - ) -> LROPoller[_models.DiskEncryptionSet]: - """Updates (patches) a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :param disk_encryption_set: disk encryption set object supplied in the body of the Patch disk - encryption set operation. Is either a model type or a IO type. Required. - :type disk_encryption_set: ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSetUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiskEncryptionSet or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - disk_encryption_set=disk_encryption_set, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: Any) -> _models.DiskEncryptionSet: - """Gets information about a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DiskEncryptionSet or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] - - request = build_get_request( - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DiskEncryptionSet", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"} # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: - """Lists all the disk encryption sets under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DiskEncryptionSet or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DiskEncryptionSetList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets"} # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: - """Lists all the disk encryption sets under a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DiskEncryptionSet or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_07_02.models.DiskEncryptionSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DiskEncryptionSetList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets"} # type: ignore - - @distributed_trace - def list_associated_resources( - self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: Any - ) -> Iterable[str]: - """Lists all resources that are encrypted with this disk encryption set. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_encryption_set_name: The name of the disk encryption set that is being created. The - name can't be changed after the disk encryption set is created. Supported characters for the - name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. Required. - :type disk_encryption_set_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either str or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_associated_resources_request( - resource_group_name=resource_group_name, - disk_encryption_set_name=disk_encryption_set_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_associated_resources.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ResourceUriList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_associated_resources.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_restore_point_operations.py deleted file mode 100644 index 7d2f468795bf..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_restore_point_operations.py +++ /dev/null @@ -1,759 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "restorePointCollectionName": _SERIALIZER.url( - "restore_point_collection_name", restore_point_collection_name, "str" - ), - "vmRestorePointName": _SERIALIZER.url("vm_restore_point_name", vm_restore_point_name, "str"), - "diskRestorePointName": _SERIALIZER.url("disk_restore_point_name", disk_restore_point_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_restore_point_request( - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "restorePointCollectionName": _SERIALIZER.url( - "restore_point_collection_name", restore_point_collection_name, "str" - ), - "vmRestorePointName": _SERIALIZER.url("vm_restore_point_name", vm_restore_point_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_grant_access_request( - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "restorePointCollectionName": _SERIALIZER.url( - "restore_point_collection_name", restore_point_collection_name, "str" - ), - "vmRestorePointName": _SERIALIZER.url("vm_restore_point_name", vm_restore_point_name, "str"), - "diskRestorePointName": _SERIALIZER.url("disk_restore_point_name", disk_restore_point_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_revoke_access_request( - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "restorePointCollectionName": _SERIALIZER.url( - "restore_point_collection_name", restore_point_collection_name, "str" - ), - "vmRestorePointName": _SERIALIZER.url("vm_restore_point_name", vm_restore_point_name, "str"), - "diskRestorePointName": _SERIALIZER.url("disk_restore_point_name", disk_restore_point_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class DiskRestorePointOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_07_02.ComputeManagementClient`'s - :attr:`disk_restore_point` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - **kwargs: Any - ) -> _models.DiskRestorePoint: - """Get disk restorePoint resource. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :param disk_restore_point_name: The name of the disk restore point created. Required. - :type disk_restore_point_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DiskRestorePoint or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.DiskRestorePoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] - - request = build_get_request( - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - disk_restore_point_name=disk_restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DiskRestorePoint", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}"} # type: ignore - - @distributed_trace - def list_by_restore_point( - self, resource_group_name: str, restore_point_collection_name: str, vm_restore_point_name: str, **kwargs: Any - ) -> Iterable["_models.DiskRestorePoint"]: - """Lists diskRestorePoints under a vmRestorePoint. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DiskRestorePoint or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_07_02.models.DiskRestorePoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_restore_point_request( - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_restore_point.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DiskRestorePointList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_restore_point.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints"} # type: ignore - - def _grant_access_initial( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> Optional[_models.AccessUri]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(grant_access_data, (IO, bytes)): - _content = grant_access_data - else: - _json = self._serialize.body(grant_access_data, "GrantAccessData") - - request = build_grant_access_request( - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - disk_restore_point_name=disk_restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._grant_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AccessUri", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _grant_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess"} # type: ignore - - @overload - def begin_grant_access( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - grant_access_data: _models.GrantAccessData, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a diskRestorePoint. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :param disk_restore_point_name: The name of the disk restore point created. Required. - :type disk_restore_point_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_grant_access( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - grant_access_data: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a diskRestorePoint. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :param disk_restore_point_name: The name of the disk restore point created. Required. - :type disk_restore_point_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Required. - :type grant_access_data: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_grant_access( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a diskRestorePoint. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :param disk_restore_point_name: The name of the disk restore point created. Required. - :type disk_restore_point_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Is either a model type or a IO type. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._grant_access_initial( # type: ignore - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - disk_restore_point_name=disk_restore_point_name, - grant_access_data=grant_access_data, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessUri", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_grant_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess"} # type: ignore - - def _revoke_access_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_revoke_access_request( - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - disk_restore_point_name=disk_restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._revoke_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _revoke_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess"} # type: ignore - - @distributed_trace - def begin_revoke_access( - self, - resource_group_name: str, - restore_point_collection_name: str, - vm_restore_point_name: str, - disk_restore_point_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Revokes access to a diskRestorePoint. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param restore_point_collection_name: The name of the restore point collection that the disk - restore point belongs. Required. - :type restore_point_collection_name: str - :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point - belongs. Required. - :type vm_restore_point_name: str - :param disk_restore_point_name: The name of the disk restore point created. Required. - :type disk_restore_point_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._revoke_access_initial( # type: ignore - resource_group_name=resource_group_name, - restore_point_collection_name=restore_point_collection_name, - vm_restore_point_name=vm_restore_point_name, - disk_restore_point_name=disk_restore_point_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_revoke_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disks_operations.py deleted file mode 100644 index 0294f7f3b69e..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disks_operations.py +++ /dev/null @@ -1,1370 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, disk_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskName": _SERIALIZER.url("disk_name", disk_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request(resource_group_name: str, disk_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskName": _SERIALIZER.url("disk_name", disk_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(resource_group_name: str, disk_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskName": _SERIALIZER.url("disk_name", disk_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskName": _SERIALIZER.url("disk_name", disk_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_grant_access_request( - resource_group_name: str, disk_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskName": _SERIALIZER.url("disk_name", disk_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_revoke_access_request( - resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "diskName": _SERIALIZER.url("disk_name", disk_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -class DisksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_07_02.ComputeManagementClient`'s - :attr:`disks` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_or_update_initial( - self, resource_group_name: str, disk_name: str, disk: Union[_models.Disk, IO], **kwargs: Any - ) -> _models.Disk: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk, (IO, bytes)): - _content = disk - else: - _json = self._serialize.body(disk, "Disk") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Disk", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Disk", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - disk_name: str, - disk: _models.Disk, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Disk]: - """Creates or updates a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Put disk operation. Required. - :type disk: ~azure.mgmt.compute.v2022_07_02.models.Disk - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - disk_name: str, - disk: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Disk]: - """Creates or updates a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Put disk operation. Required. - :type disk: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, resource_group_name: str, disk_name: str, disk: Union[_models.Disk, IO], **kwargs: Any - ) -> LROPoller[_models.Disk]: - """Creates or updates a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Put disk operation. Is either a model type - or a IO type. Required. - :type disk: ~azure.mgmt.compute.v2022_07_02.models.Disk or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_name=disk_name, - disk=disk, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Disk", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - def _update_initial( - self, resource_group_name: str, disk_name: str, disk: Union[_models.DiskUpdate, IO], **kwargs: Any - ) -> _models.Disk: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(disk, (IO, bytes)): - _content = disk - else: - _json = self._serialize.body(disk, "DiskUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Disk", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Disk", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - disk_name: str, - disk: _models.DiskUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Disk]: - """Updates (patches) a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Patch disk operation. Required. - :type disk: ~azure.mgmt.compute.v2022_07_02.models.DiskUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - disk_name: str, - disk: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Disk]: - """Updates (patches) a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Patch disk operation. Required. - :type disk: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, resource_group_name: str, disk_name: str, disk: Union[_models.DiskUpdate, IO], **kwargs: Any - ) -> LROPoller[_models.Disk]: - """Updates (patches) a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param disk: Disk object supplied in the body of the Patch disk operation. Is either a model - type or a IO type. Required. - :type disk: ~azure.mgmt.compute.v2022_07_02.models.DiskUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Disk or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( # type: ignore - resource_group_name=resource_group_name, - disk_name=disk_name, - disk=disk, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Disk", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> _models.Disk: - """Gets information about a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Disk or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.Disk - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] - - request = build_get_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Disk", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, disk_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - disk_name=disk_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"} # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Disk"]: - """Lists all the disks under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Disk or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DiskList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks"} # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: - """Lists all the disks under a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Disk or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_07_02.models.Disk] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DiskList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks"} # type: ignore - - def _grant_access_initial( - self, - resource_group_name: str, - disk_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> Optional[_models.AccessUri]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(grant_access_data, (IO, bytes)): - _content = grant_access_data - else: - _json = self._serialize.body(grant_access_data, "GrantAccessData") - - request = build_grant_access_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._grant_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AccessUri", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _grant_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess"} # type: ignore - - @overload - def begin_grant_access( - self, - resource_group_name: str, - disk_name: str, - grant_access_data: _models.GrantAccessData, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_grant_access( - self, - resource_group_name: str, - disk_name: str, - grant_access_data: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Required. - :type grant_access_data: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_grant_access( - self, - resource_group_name: str, - disk_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :param grant_access_data: Access data object supplied in the body of the get disk access - operation. Is either a model type or a IO type. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._grant_access_initial( # type: ignore - resource_group_name=resource_group_name, - disk_name=disk_name, - grant_access_data=grant_access_data, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessUri", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_grant_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess"} # type: ignore - - def _revoke_access_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, disk_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_revoke_access_request( - resource_group_name=resource_group_name, - disk_name=disk_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._revoke_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _revoke_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess"} # type: ignore - - @distributed_trace - def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs: Any) -> LROPoller[None]: - """Revokes access to a disk. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param disk_name: The name of the managed disk that is being created. The name can't be changed - after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - maximum name length is 80 characters. Required. - :type disk_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._revoke_access_initial( # type: ignore - resource_group_name=resource_group_name, - disk_name=disk_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_revoke_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_patch.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_snapshots_operations.py deleted file mode 100644 index cc628936532b..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_snapshots_operations.py +++ /dev/null @@ -1,1376 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, snapshot_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, snapshot_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(resource_group_name: str, snapshot_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, snapshot_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -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", _params.pop("api-version", "2022-07-02")) # type: str - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_grant_access_request( - resource_group_name: str, snapshot_name: str, 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", _params.pop("api-version", "2022-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_revoke_access_request( - resource_group_name: str, snapshot_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "snapshotName": _SERIALIZER.url("snapshot_name", snapshot_name, "str"), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -class SnapshotsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.compute.v2022_07_02.ComputeManagementClient`'s - :attr:`snapshots` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_or_update_initial( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.Snapshot, IO], **kwargs: Any - ) -> _models.Snapshot: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(snapshot, (IO, bytes)): - _content = snapshot - else: - _json = self._serialize.body(snapshot, "Snapshot") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_or_update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: _models.Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Required. - :type snapshot: ~azure.mgmt.compute.v2022_07_02.models.Snapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Required. - :type snapshot: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.Snapshot, IO], **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Put disk operation. Is either a - model type or a IO type. Required. - :type snapshot: ~azure.mgmt.compute.v2022_07_02.models.Snapshot or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - snapshot=snapshot, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Snapshot", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - def _update_initial( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.SnapshotUpdate, IO], **kwargs: Any - ) -> _models.Snapshot: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(snapshot, (IO, bytes)): - _content = snapshot - else: - _json = self._serialize.body(snapshot, "SnapshotUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: _models.SnapshotUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. - Required. - :type snapshot: ~azure.mgmt.compute.v2022_07_02.models.SnapshotUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - snapshot_name: str, - snapshot: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. - Required. - :type snapshot: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, resource_group_name: str, snapshot_name: str, snapshot: Union[_models.SnapshotUpdate, IO], **kwargs: Any - ) -> LROPoller[_models.Snapshot]: - """Updates (patches) a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. Is - either a model type or a IO type. Required. - :type snapshot: ~azure.mgmt.compute.v2022_07_02.models.SnapshotUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - snapshot=snapshot, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Snapshot", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> _models.Snapshot: - """Gets information about a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2022_07_02.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - - request = build_get_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Snapshot", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, snapshot_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_delete_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"} # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Snapshot"]: - """Lists snapshots under a resource group. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots"} # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: - """Lists snapshots under a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2022_07_02.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - 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 - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots"} # type: ignore - - def _grant_access_initial( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> Optional[_models.AccessUri]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(grant_access_data, (IO, bytes)): - _content = grant_access_data - else: - _json = self._serialize.body(grant_access_data, "GrantAccessData") - - request = build_grant_access_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._grant_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AccessUri", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _grant_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess"} # type: ignore - - @overload - def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: _models.GrantAccessData, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Required. - :type grant_access_data: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_grant_access( - self, - resource_group_name: str, - snapshot_name: str, - grant_access_data: Union[_models.GrantAccessData, IO], - **kwargs: Any - ) -> LROPoller[_models.AccessUri]: - """Grants access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :param grant_access_data: Access data object supplied in the body of the get snapshot access - operation. Is either a model type or a IO type. Required. - :type grant_access_data: ~azure.mgmt.compute.v2022_07_02.models.GrantAccessData or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2022_07_02.models.AccessUri] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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-07-02")) # type: str - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._grant_access_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - grant_access_data=grant_access_data, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessUri", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_grant_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess"} # type: ignore - - def _revoke_access_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, snapshot_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - - request = build_revoke_access_request( - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._revoke_access_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _revoke_access_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess"} # type: ignore - - @distributed_trace - def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kwargs: Any) -> LROPoller[None]: - """Revokes access to a snapshot. - - :param resource_group_name: The name of the resource group. Required. - :type resource_group_name: str - :param snapshot_name: The name of the snapshot that is being created. The name can't be changed - after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. - The max name length is 80 characters. Required. - :type snapshot_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._revoke_access_initial( # type: ignore - resource_group_name=resource_group_name, - snapshot_name=snapshot_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_revoke_access.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess"} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/py.typed b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_configuration.py index b328d1d686f8..a615a75336e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-08-01") # type: str + api_version = kwargs.pop("api_version", "2022-08-01") # type: Literal["2022-08-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_metadata.json index 78f9a2803847..b742cf0e3fa6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_metadata.json @@ -124,4 +124,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/_configuration.py index 470eb1972c53..6cb390662d65 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-08-01") # type: str + api_version = kwargs.pop("api_version", "2022-08-01") # type: Literal["2022-08-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_availability_sets_operations.py index 14bbde7471a4..4ca6cd3d18d5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservation_groups_operations.py index 403be17f8998..5c1e5ba4f53c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -301,7 +306,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -376,7 +381,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -443,7 +448,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -506,7 +511,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -598,7 +603,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservations_operations.py index ca4a6704c80b..10d00fd6022b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -255,7 +260,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -318,7 +323,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -485,7 +490,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -744,7 +749,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_host_groups_operations.py index 6ecd9c765a9f..c12fb4349d04 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -433,7 +438,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_hosts_operations.py index 567b30981774..0e5621a42948 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -250,7 +255,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -478,7 +483,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -536,7 +541,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -594,7 +599,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -670,7 +675,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -726,7 +731,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { @@ -809,7 +814,7 @@ async def _restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -870,7 +875,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_images_operations.py index 49ea180e2f77..30c56fcac647 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_log_analytics_operations.py index faa8817d6d81..94d077e868cc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_operations.py index 5b01d32359d4..1bccd7af7ded 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_proximity_placement_groups_operations.py index ab37a4ab0701..9758575a0c41 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_point_collections_operations.py index 6c0c069cb78f..9d3f0caf843e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -302,7 +307,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -362,7 +367,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -418,7 +423,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -490,7 +495,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -541,7 +546,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -625,7 +630,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_points_operations.py index 1ffec2c1d4e6..b0401d1377c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_request, build_delete_request, build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -236,7 +241,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -294,7 +299,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -352,7 +357,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -427,7 +432,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_ssh_public_keys_operations.py index b34528008484..2f9570719b58 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_usage_operations.py index 99aef157b02b..19d0f91f870c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extension_images_operations.py index fe4ba2da1421..a27be856e936 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extensions_operations.py index c079d4a51082..ad005b700b1f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index 43fa8b713a39..2bff7638a2b6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_operations.py index 63ce4773cd83..5b6328e9adaf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -171,7 +176,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -236,7 +241,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -292,7 +297,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -353,7 +358,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( @@ -414,7 +419,7 @@ async def list_by_edge_zone( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VmImagesInEdgeZoneListResult] request = build_list_by_edge_zone_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_run_commands_operations.py index 42d73f137885..8dfde75d2e59 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 5c72bdcabfc7..c6864e8ade6e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 7f87b5e8b2ec..d5cfb175b46b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index c292a0437949..349ebaf24761 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 51d889bafc02..2fbe8e644ce6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 57f708f33d68..d7c3d4146b44 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1678,7 +1683,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1736,7 +1741,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def simulate_eviction( # 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1853,7 +1858,7 @@ async def _run_command_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2020,7 +2025,7 @@ async def begin_run_command( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_sets_operations.py index 069b7ff72062..7d3f979acbc5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -671,7 +676,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,7 +749,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -797,7 +802,7 @@ async def _deallocate_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -955,7 +960,7 @@ async def begin_deallocate( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -1015,7 +1020,7 @@ async def _delete_instances_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1177,7 +1182,7 @@ async def begin_delete_instances( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -1245,7 +1250,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1295,7 +1300,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1379,7 +1384,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1467,7 +1472,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1556,7 +1561,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1644,7 +1649,7 @@ async def _power_off_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1818,7 +1823,7 @@ async def begin_power_off( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -1878,7 +1883,7 @@ async def _restart_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2030,7 +2035,7 @@ async def begin_restart( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -2089,7 +2094,7 @@ async def _start_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2241,7 +2246,7 @@ async def begin_start( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -2300,7 +2305,7 @@ async def _redeploy_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2455,7 +2460,7 @@ async def begin_redeploy( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -2514,7 +2519,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2675,7 +2680,7 @@ async def begin_perform_maintenance( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -2734,7 +2739,7 @@ async def _update_instances_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2883,7 +2888,7 @@ async def begin_update_instances( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -2942,7 +2947,7 @@ async def _reimage_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3098,7 +3103,7 @@ async def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -3157,7 +3162,7 @@ async def _reimage_all_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3312,7 +3317,7 @@ async def begin_reimage_all( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -3395,7 +3400,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3527,7 +3532,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3587,7 +3592,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3735,7 +3740,7 @@ async def begin_set_orchestration_service_state( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_sizes_operations.py index 2aa46c7ff70c..457f470ffb47 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machines_operations.py index 1393f203deba..0a1745e3d0bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1236,7 +1241,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1306,7 +1311,7 @@ async def generalize( # 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1359,7 +1364,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1452,7 +1457,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1541,7 +1546,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1624,7 +1629,7 @@ async def _power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1685,7 +1690,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1738,7 +1743,7 @@ async def _reapply_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1791,7 +1796,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1843,7 +1848,7 @@ async def _restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1896,7 +1901,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1948,7 +1953,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2001,7 +2006,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2053,7 +2058,7 @@ async def _redeploy_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2106,7 +2111,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2162,7 +2167,7 @@ async def _reimage_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2312,7 +2317,7 @@ async def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -2387,7 +2392,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2436,7 +2441,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2491,7 +2496,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2555,7 +2560,7 @@ async def simulate_eviction( # 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2599,7 +2604,7 @@ async def _assess_patches_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2662,7 +2667,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2722,7 +2727,7 @@ async def _install_patches_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2883,7 +2888,7 @@ async def begin_install_patches( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2942,7 +2947,7 @@ async def _run_command_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3095,7 +3100,7 @@ async def begin_run_command( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/_models_py3.py index 280158b7aa78..0ff9eb4ec318 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -87,8 +92,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_availability_sets_operations.py index fe1860bb4ebc..069e02afffef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_list_by_subscription_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -228,7 +233,7 @@ def build_list_available_sizes_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -362,7 +367,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -498,7 +503,7 @@ def 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -570,7 +575,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -673,7 +678,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -755,7 +760,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -842,7 +847,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservation_groups_operations.py index 3ef1956e1003..430423038cbc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_by_subscription_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,7 +370,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -510,7 +515,7 @@ def 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -585,7 +590,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -715,7 +720,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -807,7 +812,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservations_operations.py index 1b6b2aba530a..f67de7bb0ff6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -89,7 +94,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -130,7 +135,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_capacity_reservation_group_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -446,7 +451,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -509,7 +514,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -676,7 +681,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -802,7 +807,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -879,7 +884,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -935,7 +940,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_host_groups_operations.py index 3ba9399a03f3..ddba89d69be8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +182,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +210,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -480,7 +485,7 @@ def 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -552,7 +557,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -667,7 +672,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -748,7 +753,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_hosts_operations.py index 4dd6eb708a8a..c7b84d0ffc8a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_list_by_host_group_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +222,7 @@ def build_restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +286,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -447,7 +452,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -510,7 +515,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -672,7 +677,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -730,7 +735,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -788,7 +793,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -864,7 +869,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -919,7 +924,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { @@ -1002,7 +1007,7 @@ def _restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1063,7 +1068,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_images_operations.py index 60749486a4a6..8b29920ef548 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_delete_request(resource_group_name: str, image_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -400,7 +405,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -457,7 +462,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -606,7 +611,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -663,7 +668,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -716,7 +721,7 @@ def begin_delete(self, resource_group_name: str, image_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -782,7 +787,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -831,7 +836,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -912,7 +917,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_log_analytics_operations.py index 3b37847f5742..90a81102be98 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: str, subscription_id _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(location: 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_operations.py index a305f8e248bb..5db44897dcf4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_proximity_placement_groups_operations.py index 6085bfeaab8e..548dcab74077 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -490,7 +495,7 @@ def 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -562,7 +567,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -674,7 +679,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -759,7 +764,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_point_collections_operations.py index ec868bb10a4a..ae255654ac21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -496,7 +501,7 @@ def 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -556,7 +561,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,7 +689,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -735,7 +740,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -819,7 +824,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_points_operations.py index ad5f6f0756e9..a840ca3cbdeb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +200,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -360,7 +365,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -418,7 +423,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -476,7 +481,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -551,7 +556,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_ssh_public_keys_operations.py index 51944122dc23..94fd665d236b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,7 @@ def build_generate_key_pair_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -283,7 +288,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -369,7 +374,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -527,7 +532,7 @@ def create( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -667,7 +672,7 @@ def 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -739,7 +744,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -793,7 +798,7 @@ def get(self, resource_group_name: str, ssh_public_key_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -855,7 +860,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_usage_operations.py index 19d6874b7ed0..cfb29b6130e7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extension_images_operations.py index 8d7c89b03ae2..08f8324aaee7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_name: str, subscription_id _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extensions_operations.py index 611a17eb82e9..05aaaae223c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +189,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -424,7 +429,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -659,7 +664,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -717,7 +722,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -776,7 +781,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -850,7 +855,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -914,7 +919,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_edge_zone_operations.py index 0f22d35b450c..6a78475a8272 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: str, subscription_id _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_operations.py index aca4986592f3..7d90c8b51119 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ def build_list_by_edge_zone_request(location: str, edge_zone: str, subscription_ _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +289,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -366,7 +371,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -431,7 +436,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -487,7 +492,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -548,7 +553,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( @@ -607,7 +612,7 @@ def list_by_edge_zone(self, location: str, edge_zone: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VmImagesInEdgeZoneListResult] request = build_list_by_edge_zone_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_run_commands_operations.py index c58093120e46..3fc0bfbceb7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: str, subscription_id: str, **kw _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_extensions_operations.py index 33fe9023cf7d..51a94688a995 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -425,7 +430,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -488,7 +493,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -664,7 +669,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -722,7 +727,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -781,7 +786,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -855,7 +860,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -911,7 +916,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index b91f72cea96d..2cf71de5649a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_cancel_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_start_os_upgrade_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,7 @@ def build_start_extension_upgrade_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +140,7 @@ def build_get_latest_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def _cancel_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -246,7 +251,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -298,7 +303,7 @@ def _start_os_upgrade_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -355,7 +360,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -407,7 +412,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -464,7 +469,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +533,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 894d7daaea11..a8c3a85a202e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 501337d86bf5..55c7662f5297 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,7 +176,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vms_operations.py index 85a26b779817..ea33deaeb26c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_reimage_all_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -184,7 +189,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +263,7 @@ def build_get_instance_view_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +302,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ def build_power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +413,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -440,7 +445,7 @@ def build_redeploy_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -478,7 +483,7 @@ def build_retrieve_boot_diagnostics_data_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -514,7 +519,7 @@ def build_perform_maintenance_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +551,7 @@ def build_simulate_eviction_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -578,7 +583,7 @@ def build_run_command_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -645,7 +650,7 @@ def _reimage_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -807,7 +812,7 @@ def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -863,7 +868,7 @@ def _reimage_all_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -922,7 +927,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -975,7 +980,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1035,7 +1040,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1093,7 +1098,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1267,7 +1272,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1330,7 +1335,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1397,7 +1402,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1479,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1538,7 +1543,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1609,7 +1614,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1700,7 +1705,7 @@ def _power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1770,7 +1775,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1824,7 +1829,7 @@ def _restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1882,7 +1887,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1935,7 +1940,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1993,7 +1998,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2046,7 +2051,7 @@ def _redeploy_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2105,7 +2110,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2182,7 +2187,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2232,7 +2237,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2290,7 +2295,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2357,7 +2362,7 @@ def simulate_eviction( # 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2407,7 +2412,7 @@ def _run_command_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2571,7 +2576,7 @@ def begin_run_command( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_sets_operations.py index 5f92975106cf..22e43fd19a52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -145,7 +150,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +188,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -255,7 +260,7 @@ def build_delete_instances_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -291,7 +296,7 @@ def build_get_instance_view_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ def build_list_all_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_list_skus_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -407,7 +412,7 @@ def build_get_os_upgrade_history_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -443,7 +448,7 @@ def build_power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -479,7 +484,7 @@ def build_restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -513,7 +518,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -547,7 +552,7 @@ def build_redeploy_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -581,7 +586,7 @@ def build_perform_maintenance_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -615,7 +620,7 @@ def build_update_instances_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -649,7 +654,7 @@ def build_reimage_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -683,7 +688,7 @@ def build_reimage_all_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -724,7 +729,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -760,7 +765,7 @@ def build_convert_to_single_placement_group_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -794,7 +799,7 @@ def build_set_orchestration_service_state_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -858,7 +863,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -944,7 +949,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1102,7 +1107,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1163,7 +1168,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1317,7 +1322,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1374,7 +1379,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1433,7 +1438,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1506,7 +1511,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1559,7 +1564,7 @@ def _deallocate_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1717,7 +1722,7 @@ def begin_deallocate( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -1777,7 +1782,7 @@ def _delete_instances_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1939,7 +1944,7 @@ def begin_delete_instances( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -2007,7 +2012,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2057,7 +2062,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2141,7 +2146,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2229,7 +2234,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2318,7 +2323,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2406,7 +2411,7 @@ def _power_off_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2580,7 +2585,7 @@ def begin_power_off( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -2640,7 +2645,7 @@ def _restart_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2792,7 +2797,7 @@ def begin_restart( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -2851,7 +2856,7 @@ def _start_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3003,7 +3008,7 @@ def begin_start( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -3062,7 +3067,7 @@ def _redeploy_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3217,7 +3222,7 @@ def begin_redeploy( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -3276,7 +3281,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3437,7 +3442,7 @@ def begin_perform_maintenance( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -3496,7 +3501,7 @@ def _update_instances_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3645,7 +3650,7 @@ def begin_update_instances( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -3704,7 +3709,7 @@ def _reimage_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3860,7 +3865,7 @@ def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -3919,7 +3924,7 @@ def _reimage_all_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4074,7 +4079,7 @@ def begin_reimage_all( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -4157,7 +4162,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4289,7 +4294,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4349,7 +4354,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4497,7 +4502,7 @@ def begin_set_orchestration_service_state( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_sizes_operations.py index 7df2f0577374..7677f84c8d8b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machines_operations.py index 368a4f3b3f72..502c202b8b89 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -175,7 +180,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +251,7 @@ def build_instance_view_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def build_convert_to_managed_disks_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_deallocate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -341,7 +346,7 @@ def build_generalize_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +377,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -404,7 +409,7 @@ def build_list_all_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -434,7 +439,7 @@ def build_list_available_sizes_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -465,7 +470,7 @@ def build_power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -496,7 +501,7 @@ def build_reapply_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -525,7 +530,7 @@ def build_restart_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -554,7 +559,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -583,7 +588,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -612,7 +617,7 @@ def build_reimage_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -651,7 +656,7 @@ def build_retrieve_boot_diagnostics_data_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -686,7 +691,7 @@ def build_perform_maintenance_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -717,7 +722,7 @@ def build_simulate_eviction_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -748,7 +753,7 @@ def build_assess_patches_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -779,7 +784,7 @@ def build_install_patches_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -813,7 +818,7 @@ def build_run_command_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -875,7 +880,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -961,7 +966,7 @@ def _capture_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1121,7 +1126,7 @@ def begin_capture( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1180,7 +1185,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1335,7 +1340,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1392,7 +1397,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1540,7 +1545,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1597,7 +1602,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1656,7 +1661,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1731,7 +1736,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1792,7 +1797,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1840,7 +1845,7 @@ def _convert_to_managed_disks_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1894,7 +1899,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1946,7 +1951,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -2006,7 +2011,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2076,7 +2081,7 @@ def generalize( # 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2128,7 +2133,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2220,7 +2225,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2308,7 +2313,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2391,7 +2396,7 @@ def _power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2452,7 +2457,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2505,7 +2510,7 @@ def _reapply_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2558,7 +2563,7 @@ def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2610,7 +2615,7 @@ def _restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2663,7 +2668,7 @@ def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2715,7 +2720,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2768,7 +2773,7 @@ def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2820,7 +2825,7 @@ def _redeploy_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2873,7 +2878,7 @@ def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2929,7 +2934,7 @@ def _reimage_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3079,7 +3084,7 @@ def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] 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] @@ -3154,7 +3159,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3203,7 +3208,7 @@ def _perform_maintenance_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3256,7 +3261,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3320,7 +3325,7 @@ def simulate_eviction( # 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3364,7 +3369,7 @@ def _assess_patches_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3427,7 +3432,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3487,7 +3492,7 @@ def _install_patches_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3648,7 +3653,7 @@ def begin_install_patches( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3707,7 +3712,7 @@ def _run_command_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3857,7 +3862,7 @@ def begin_run_command( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod]